How to set error page location for NonexistentConversationException?

I need help with expired / nonexistent conversation when ?cid=XX is in the url. I 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, this did not work. I am still getting an error and cannot switch to index.xhtml . How can I solve this problem?

+4
source share
2 answers

You need to explicitly indicate that the conversation should not be distributed for a specific request. Add nocid=true as the 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 for past conversations involving CDI and JSF

+4
source

The instance to exclude welding works in web.xml:

 <error-page> <exception-type>javax.enterprise.context.NonexistentConversationException</exception-type> <location>/index.xhtml?nocid=true</location> </error-page> 
+1
source

Source: https://habr.com/ru/post/1495038/


All Articles