I need some assistence getting my exceptions routed to my own /error.xhtml page. I have a seam gen'd project from around 3 days old CVS.
No matter what I do, I can't get seam to redirect to the /error.xhtml after an exception, please help.
I am getting the page that looks like:
An Error Occurred:
....
+ Stack Trace
+ Component Tree
+ Scoped Variables
Here is my code, where am I going wrong? I also removed the jboss-seam-debug jar but that only prevents me from seeing the debug.seam page, I still get this page, and I want my error.xhtml.
components.xml:
.... <core:init debug="false" jndi-pattern="@jndiPattern@"/> ....
<!DOCTYPE pages PUBLIC "-//JBoss/Seam Pages Configuration DTD 1.2//EN" "http://jboss.com/products/seam/pages-1.2.dtd"> <pages no-conversation-view-id="/index.xhtml" login-view-id="/login.xhtml"> <page view-id="*"> <navigation> <rule if-outcome="home"> <redirect view-id="/index.xhtml"/> </rule> </navigation> </page> <exception class="org.jboss.seam.framework.EntityNotFoundException"> <redirect view-id="/error.xhtml"> <message>Not found</message> </redirect> </exception> <exception class="javax.persistence.EntityNotFoundException"> <redirect view-id="/error.xhtml"> <message>Not found</message> </redirect> </exception> <exception class="javax.persistence.OptimisticLockException"> <end-conversation/> <redirect view-id="/error.xhtml"> <message>Another user changed the same data, please try again</message> </redirect> </exception> <exception class="org.jboss.seam.security.AuthorizationException"> <redirect> <message>You don't have permission to do this</message> </redirect> </exception> <exception class="org.jboss.seam.security.NotLoggedInException"> <redirect view-id="/login.xhtml"> <message>Please log in first</message> </redirect> </exception> <exception> <redirect view-id="/error.xhtml"> <message>Unexpected error, please try again</message> </redirect> </exception> </pages>
You need to turn off BOTH seam debug mode AND facelets development mode!