Re: testing servlets that reference jsps

"Wolfgang Fahl - BITPlan" <[email protected]>
Newsgroups gmane.comp.web.httpunit.devel
Organization bitplan GmbH
Message-ID <[email protected]>
Patrick,

you wrote:

>

> My servlet test code looks like this:

> WebRequest request = new GetMethodWebRequest(

> "http://test.meterware.com/myservlet" );

> WebResponse response = sc.getResponse( request );

> --

>

> When I run the test I get this error:

>

> com.meterware.httpunit.HttpNotFoundException: Error on HTTP request: 404

> /myjsp.jsp [http://test.meterware.com/myservlet?myparam=foo]

> at com.meterware.httpunit.WebClient.validateHeaders(WebClient.java:575)

> at com.meterware.httpunit.WebClient.updateClient(WebClient.java:464)

> ....

>

> How can I specify the root path of the jsp so that the ServletRunner can

> know how to locate the JSP?

I assume test.meterware.com is not the server that your are testing. You

might want to change the URL.

There are some testcases in

HttpServletRequestTest

where the source code might be interesting for you.

Otherwise I'm not familiar enough with the servlet side of httpunit yet to
help.

Wolfgang

BITPlan - smart solutions

Pater-Delp-Str. 1, D-47877 Willich Schiefbahn

Tel. +49 1805 - BITPLAN / +49 1805 248 752, Fax +49 2154 811-481

Web: http://www.bitplan.de

bitplan GmbH, Willich - HRB 6820 Krefeld, VAT-ID: 10258040548, Geschäftsführer: Wolfgang Fahl

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.