Hi,
I have searched through the list and have seen and tried numerous different
responses to this problem but with no luck. I have seen the discussion on
getServletContext(), but I know that I am missing something real basic here.
My problem is that I am trying out the example from Java World which uses a
Servlet to redirect to different jsp pages. I am wondering if it is a bug with JWS2.0
or not. I am using JWS2.0 and Win98.
If I call the page first in the browser like this
http://karldii:8080/examples/jsp/shopping/Checkout.jsp, I don't get the error when I
use forward. I assume this happens because it is currently in memory.
Also, the examples/jsp/... directory is at the next level below the JavaWebServer2.0
directory.
I am trying to redirect my response to a new .jsp page using the usual
RequestDispatcher rd =
getServletContext().getRequestDispatcher"/examples/jsp/shopping/Checkout.jsp");
rd.forward(req,res)
I get the following error
500 Internal Server Error
The servlet named ShoppingServlet at the requested URL
http://karldii:8080/servlet/ShoppingServlet
reported this exception: . Please report this to the administrator of the web server.
java.lang.NullPointerException: at
com.sun.server.http.pagecompile.GenericPageCompileServlet.loadClass(GenericPageCompileServlet.java:517)
at
com.sun.server.http.pagecompile.jsp.runtime.JspServlet.compileAndLoadServlet(JspServlet.java:274)
at
com.sun.server.http.pagecompile.jsp.runtime.JspServlet.processJspPage(JspServlet.java:254)
at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.service(JspServlet.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) at
com.sun.server.ServletState.callService(ServletState.java:226) at
com.sun.server.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:202) at
com.sun.server.http.HttpRequestDispatcherImpl.forward(HttpRequestDispatcherImpl.java:249)
at ShoppingServlet.doPost(ShoppingServlet.java, Compiled Code) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:747) at
javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) at
com.sun.server.ServletState.callService(ServletState!
!
.java:226) at
com.sun.server.ServletManager.callServletService(ServletManager.java:936) at
com.sun.server.http.servlet.InvokerServlet.service(InvokerServlet.java:137) at
javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) at
com.sun.server.ServletState.callService(ServletState.java:226) at
com.sun.server.ServletManager.callServletService(ServletManager.java:936) at
com.sun.server.ProcessingState.invokeTargetServlet(ProcessingState.java:423) at
com.sun.server.http.HttpProcessingState.execute(HttpProcessingState.java:79) at
com.sun.server.http.stages.Runner.process(Runner.java:79) at
com.sun.server.ProcessingSupport.process(ProcessingSupport.java:294) at
com.sun.server.Service.process(Service.java:204) at
com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java:374) at
com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java:166) at
com.sun.server.HandlerThread.run(HandlerThread.java:162)
Any help would be greatly appreciated
Karl
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html