JSF Page Navigation: Unexpected RuntimeException
I have the following navigation rules defined in faces-config.xml. I am able to navigate to second page, however from second page to first, I am not able to navigate. What could the reason, anything wrong with navigation rules? I would like to do navigation without redirect.
JSF version is 1.1
<navigation-rule>
<from-view-id>/first.jspx</from-view-id>
<navigation-case>
<from-action>#{bean.setSelectedItem}</from-action>
<from-outcome>form1</from-outcome>
<to-view-id>/second.jspx</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/second.jspx</from-view-id>
<navigation-case>
<from-action>#{bean2.testBack}</from-action>
<from-outcome>form2</from-outcome>
<to-view-id>/first.jspx</to-view-id>
</navigation-case>
</navigation-rule>
From firebug I could see the following exception
java.lang.RuntimeException: no message available
Thanks
Update 1
Code in my second.jspx to return back to first.jspx
<ice:form id="form2">
<ice:commandLink action="#{bean.testBack}">
<h:outputText value="Test" />
</ice:commandLink>
</ice:form>
Code when I click the action
public String testBack() {
try {
logger.info("invoked");
} catch (Exception e) {
e.printStackTrace();
}
return "form2";
}
Stacktrace
java.lang.RuntimeException: no message available
at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:173)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAc开发者_StackOverflow社区ceptHandler.java:33)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
at com.icesoft.faces.context.DOMResponseWriter.enhanceAndFixDocument(DOMResponseWriter.java:315)
at com.icesoft.faces.context.DOMResponseWriter.endDocument(DOMResponseWriter.java:186)
at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:496)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:153)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:16)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:114)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:66)
at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:28)
at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$1.service(SessionDispatcher.java:42)
at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:18)
at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:62)
at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:22)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:153)
you can try this: (I copied this from my project so please change the values ;-) )
<navigation-rule>
<from-view-id>/pages/registration.jspx</from-view-id>
<navigation-case>
<from-outcome>next</from-outcome>
<to-view-id>/pages/registration.jspx</to-view-id>
</navigation-case>
<navigation-rule>
or is there any specific reason why you use this tag?
<from-action>#{bean.setSelectedItem}</from-action>
精彩评论