You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Oleg V Alexeev <go...@penza.net> on 2000/12/04 15:13:07 UTC
bug in ActionServlet
Hello,
Correct me, please, if I write wrong code.
I define global forward in struts-config.xml as -
<forward name="error" path="error.jsp" redirect="false"/>
And use this forward in one of my action classes -
if ( errors.size() > 0 ) {
saveErrors(request, errors);
forward = mapping.findForward("error");
return forward;
}
After 'return forward;' exception appeares in ActionServlet -
java.lang.NullPointerException
at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1468)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1334)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:447)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
But if I place forward description in action section -
<action path="/logon"
type="bcom.actions.LogonAction"
name="logonForm"
scope="request">
<forward name="error" path="/error.jsp"/>
<forward name="success" path="/index.jsp" redirect="true"/>
</action>
then all is ok!
--
Best regards,
Oleg mailto:gonza@penza.net
Re[2]: bug in ActionServlet
Posted by Oleg V Alexeev <go...@penza.net>.
Hello Jim,
Tuesday, December 05, 2000, 2:17:15 AM, you wrote:
JR> You don't have a "/" infront of the error.jsp here. That might
JR> be a start.
Thank you. It is work.
--
Best regards,
Oleg mailto:gonza@penza.net
Re: bug in ActionServlet
Posted by Jim Richards <gr...@cyber4.org>.
> <forward name="error" path="error.jsp" redirect="false"/>
You don't have a "/" infront of the error.jsp here. That might
be a start.
> <action path="/logon"
> type="bcom.actions.LogonAction"
> name="logonForm"
> scope="request">
> <forward name="error" path="/error.jsp"/>
> <forward name="success" path="/index.jsp" redirect="true"/>
> </action>