Is there a way (in JSF 2) to catch a Conversation timeout and redirect a user to a new page? I’m getting nasty NullPointerExceptions when the conversation times out.
I could redirect the user on all NPE’s, but that seems like too big a net.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is a bug with Weld 1.0.0 the RI for CDI
https://jira.jboss.org/browse/WELD-550
This has apparently been fixed in the Weld trunk, I don’t know in which release it’s available. In trunk, a
org.jboss.weld.context.NonexistentConversationExceptionexception is thrown, when trying to access an expired conversation. This Exception can be trapped with a customExceptionHandler, and redirect the user to an appropriate page. See this blog for more details on creating an customExceptionHandler:http://weblogs.java.net/blog/edburns/archive/2009/09/03/dealing-gracefully-viewexpiredexception-jsf2