jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dahai Guo <guo...@yahoo.com>
Subject Problem about RequestDispatcher causing NullPointerException in Cactus
Date Fri, 05 Feb 2010 13:42:06 GMT
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


Mime
View raw message