json - Java 6 EE Navigate to Error Page When Getting JSonParseException -
i working primefaces 5.0, java 6 ee.
how can navigate error.jsf page when com.fasterxml.jackson.core.jsonparseexception occurs?
it doesn't matter java class throws jsonparseexception . have handle exception in wherever occurs.
create error xhtml page. in web.xml can configure error-page elements act upon error-code or exception-type. typically, might configure @ end of web.xml following:
<error-page> <error-code>500</error-code> <location>/web-inf/jsfpages/errorpages/errorpage500.xhtml</location> </error-page> <error-page> <error-code>503</error-code> <location>/web-inf/jsfpages/errorpages/errorpage503.xhtml</location> </error-page> <error-page> <exception-type>java.sql.sqlexception</exception-type> <location>/web-inf/jsfpages/errorpages/errorpage500.xhtml</location> </error-page>
to handle ajaxrelated exception can use omnifaces fullajaxexceptionhandlerfactory.
http://balusc.blogspot.in/2012/03/full-ajax-exception-handler.html
Comments
Post a Comment