My environment is: NetBeans7.2.1, GlassFish3.1, JSF2 and Weld 1.1.0.
When the conversation time expires, I would like to redirect to error.xhtml page. Inside web.xml I added this code:
<error-page>
<exception-type>org.jboss.weld.context.NonexistentConversationException</exception-type>
<location>/error.xhtml</location>
</error-page>
But then I get this exception error:
WARNING: org.apache.catalina.core.StandardHostValve@365f4aa6: Exception Processing ErrorPage[exceptionType=org.jboss.weld.context.NonexistentConversationException, location=/error.xhtml]
javax.servlet.ServletException: WELD-000321 No conversation found to restore for id 1
When I use Servlet Listener named ErrorHandler to catch this exception with this code inside the web.xml:
<error-page>
<exception-type>org.jboss.weld.context.NonexistentConversationException</exception-type>
<location>/ErrorHandler</location>
</error-page>
It works fine, and I'm redirecting to error.xhtml from there.
I need the location to work directly throgh the web.xml (and not thriugh the servlet).
I tried changing the xhtml
page to html
, it still did not work but the exception was diffrent:
WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
org.jboss.weld.context.NonexistentConversationException: WELD-000321 No conversation found to restore for id 1
I also tried changing the root of the location to /faces/error.xhtml
, and it still did not work.
What could be the problem? How can I redirect to a page from the web.xml ?
Thank's In Advance.