Hi all,
When using the Netscape Browser 6.0, I am experiencing a
NullPointerException when forwarding the request from one page to another
using either requestDispatcher.forward in servlet or <jsp:forward> in jsp.
e.g. I have an HTML with form submitting to the DirectRequest.jsp page as
shown the following:
<body>
<%
String p=request.getParameter("p");
String destination=null;
if (p.equals("v1")) {
destination="page1.jsp";
}
else if (p.equals("v2")) {
destination="page2.jsp";
}
else if (p.equals("v3")) {
destination="page3.jsp";
}
%>
<jsp:forward page="<%= destination %>" />
</body>
The error is like the following:
null
java.lang.NullPointerException
at
jrun__docs__DirectRequest2ejsp17._jspService(jrun__docs__DirectRequest2ejsp1
7.java:40)
at
allaire.jrun.jsp.HttpJSPServlet.service(../jsp/HttpJSPServlet.java:40)
at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1013)
at
allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:925)
at
allaire.jrun.servlet.JRunNamedDispatcher.forward(../servlet/JRunNamedDispatc
her.java:34)
at allaire.jrun.jsp.JSPServlet.service(../jsp/JSPServlet.java:175)
at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1013)
at
allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:925)
at
allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDis
patcher.java:88)
at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1131)
at
allaire.jrun.servlet.JvmContext.dispatch(../servlet/JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(../http/WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(../ThreadPool.java:272)
Line 40 of jrun__docs__DirectRequest2ejsp17.java is
if (p.equals("v1")) {
Looks like after the forwarding, the request object wouldn't recognize any
form parameters and will always think they are null. In the example, it
thinks p is null. But if take out the forwarding line from the jsp page,
the value of the parameter p won't be null.
The same exact pages work correctly in IE5.5. Did any of you ever
experience the same thing or have any solutions? Any help is greatly
appreciated.
Regards,
Sue
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists