RE: [Httpunit-develop] Setting default servelt for ServletRunner
Brought to you by:
russgold
From: <Geo...@we...> - 2005-05-26 13:13:03
|
Chris, I don't remember the exact problems I had, but I found that this: File webXml =3D new File("./WebRoot/WEB-INF/web.xml"); ServletRunner sr =3D new ServletRunner(webXml,""); cleared up my problems when I was doing something similar. As I recall, using that particular constructor for ServletRunner was not obvious to me at the time, but once I did, it found the web.xml (containing the servlet-mapping) and was happy. Hope this helps, George http://www.idiacomputing.com/moin > -----Original Message----- > From: Morris, C (Chris) [mailto:c.m...@dl...]=20 > Sent: Thursday, May 26, 2005 4:53 AM > To: htt...@li... > Subject: [Httpunit-develop] Setting default servelt for ServletRunner >=20 >=20 > Hi, >=20 > Than you for HTTPUnit, this is a very cool package. >=20 > I am testing with the ServletRunner. I can get pages from my=20 > servlets fine, but when I make a request that requires a page=20 > to be parsed, I get: > =20 > com.meterware.httpunit.HttpNotFoundException: Error on HTTP=20 > request: 404 No servlet mapping defined=20 > [http://localhost:8081/pims/javascript/pims.js> ] >=20 > It didn't help to add > runner.registerServlet("default",=20 > "org.apache.catalina.servlets.DefaultServlet"); >=20 > I see from the change list that the ServletRunner=20 > suports the default servlet, but how do I configure this? > I haven't provided the relevant file path anywhere, > unless it guesses it from the file path for my web.xml. =20 >=20 > regards, > Chris |