Hi,
I'm trying to capture the exception when a user tries to access a non-existing page.
My current configuration is the following:
where CustomExceptionResolver is a subclass of SimpleMappingExceptionResolver.Code:<bean id="exceptionResolver" class="mypackage.CustomExceptionResolver"> <property name="exceptionMappings"> <props> <prop key="java.lang.Exception"> error </prop> </props> </property> <property name="excludeExceptions"> <value>org.springframework.security.AccessDeniedException , org.springframework.security.AuthenticationException, org.springframework.webflow.execution.FlowExecutionException</value> </property> </bean>
When I access a non-exisiting page, I get the following error:
I thought this would be caught by the SimpleMappingExceptionResolver, but apparently it isn't.Code:org.springframework.web.util.NestedServletException: Request processing failed; nested exception is javax.faces.FacesException: /WEB-INF/intranet/ab.xhtml Not Found in ExternalContext as a Resource
Anybody has any idea how to capture this exception gracefully in Spring and redirect to some other page?
Cheers, bo


Reply With Quote