문제

I need help handling the expired/non-existent conversation when ?cid=XX is in the URL. I have tried to put

<error-page>
    <exception-type>org.jboss.weld.context.ContextNotActiveException</exception-type>
    <location>/faces/index.xhtml</location>
</error-page>
<error-page>
    <exception-type>org.jboss.weld.context.NonexistentConversationException</exception-type>
    <location>/faces/index.xhtml</location>
</error-page>

However these didn't work. I still get the error and couldn't forward to index.xhtml. How can I solve this problem?

도움이 되었습니까?

해결책

You have to to explicitly specify that a conversation shouldn't be propagated for a particular request. Add nocid=true as a parameter at the end of your index.xhtml.

<error-page>
    <exception-type>org.jboss.weld.context.NonexistentConversationException</exception-type>
    <location>/faces/index.xhtml?nocid=true</location>
</error-page>

Refer to the following link expired conversations involving CDI and JSF

다른 팁

The ancester to the weld exception works in web.xml:

<error-page>
    <exception-type>javax.enterprise.context.NonexistentConversationException</exception-type>
    <location>/index.xhtml?nocid=true</location>
</error-page>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top