I think it would be interesting a new exceptions handling method: use case exceptions handling.
Imagine this scenario: I've got a use case object that throws a Runtime exception when it fails:
public void createNewAccount() { if(useIsVerySilly()) { throw new UserIsVerySillyException(); } }
And UserIsVerySillyException:
public class UserIsVerySillyException extends RuntimeException { }
I don't want pages.xml traps this exception. I want current page .pages.xml navigation files capture it, to show a beautiful bundled message on it.
myusecasepage.page.xml should be:
<exception class="org.test.UserIsVerySillyException"> <redirect view-id="#{facesContext.externalContext.requestServletPath}"> <message>#{messages['user_very_silly']}</message> </redirect> </exception>
So, basically, to trap exceptions in the same page they are generated.
I have the same problem, I can catch the exceptions in pages.xml but I can't catch it in *.page.xml.