fun with NetBeans & StrutsTestCase
- From: "Phlip" <phlip2005@xxxxxxxxx>
- Date: 14 Sep 2005 11:56:48 -0700
Phlip wrote:
> Newsgroupies:
> http://strutstestcase.sourceforge.net/
> public void testSuccessfulLogin() {
>
> addRequestParameter("username","deryl");
> addRequestParameter("password","radar");
> setRequestPathInfo("/login");
>
> actionPerform(); // <-- trouble
>
> verifyForward("success");
> SEVERE: The /WEB-INF/web.xml was not found.
This thread seems to cover that:
http://www.testdriven.com/modules/newbb/viewtopic.php?topic_id=1683&forum=6&PHPSESSID=15bdc965449e56e1840e18d5a0157c73
Sorry about the long URL (not my site!). I'l summarize:
George D: The /WEB-INF/web.xml was not found.
JBRainsberger: Create the ServletRunner, passing in the fully-qualified
pathname of
web.xml (which you can extract to a JVM property or something). That
should help.
New question: The ServletRunner from what JAR? Google only references a
'com.netscape' JAR, and I don't want to add someone else's servlet
system to this Tomcat mix.
George D: File webXml = new
File("/home/george/workspace/MyProj/WebRoot/WEB-INF/web.xml");
assertTrue(webXml.canRead());
ServletRunner sr = new ServletRunner(webXml,"");
It seems that our previous use of a relative path wasn't the problem,
it
was the lack of context for Struts.
We're still having difficulty. We register the ActionServlet ok:
sr.registerServlet("RequestInfo", ActionServlet.class.getName());
But what name do we use for the servlet that the JSP compiles to? And
should it be registered as JspServlet.class.getName()?
New question: Where is he calling those lines, and to what does he pass
the sr?
George D: Yay! We got a green bar. It turns out we don't need to
register the
JspServlet, but we *do* need to include the commons-el.jar on the
classpath. <sigh>
This leaves me searching for commons-el.jar.
Yes, I'm gonna get JBR's book, but does anyone have a code drop with
all this stuff in it?
--
Phlip
.
- Follow-Ups:
- Re: fun with NetBeans & StrutsTestCase
- From: etienno
- Re: fun with NetBeans & StrutsTestCase
- References:
- fun with NetBeans & StrutsTestCase
- From: Phlip
- fun with NetBeans & StrutsTestCase
- Prev by Date: fun with NetBeans & StrutsTestCase
- Next by Date: Re: Eclipse/CVS/Ant
- Previous by thread: fun with NetBeans & StrutsTestCase
- Next by thread: Re: fun with NetBeans & StrutsTestCase
- Index(es):