You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Dahai Guo <gu...@yahoo.com> on 2010/02/05 14:42:06 UTC
Problem about RequestDispatcher causing NullPointerException in Cactus
Hi,
I am new to Cactus and trying to run an in-container test to a servlet. In this servlet, the request is dispatched to a jsp:
1. RequestDispatcher view = request.getRequestDispatcher("display.jsp");
2. view.forward(request, response);
I was using the following main method to launch the Jetty webserver:
public class TestAdminSuite {
public static Test suite(){
System.setProperty("cactus.contextURL", "http://localhost:8080");
TestSuite suite = new TestSuite("all test with Jetty");
suite.addTestSuite(TestAdminServlet.class);
return new Jetty5xTestSetup(suite);
}
}
Then "view.forward(request,response);" would cause NullPointerException. I think that the problem occurs when the Jetty web server cannot locate the jsp file. I really cannot figure out how to let Jetty know where the jsp file is.
Any hint will be greatly appreciated!
Dahai
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org