Announcement Announcement Module
Collapse
No announcement yet.
How to capture non-existing URL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to capture non-existing URL

    Hi,

    I'm trying to capture the exception when a user tries to access a non-existing page.
    My current configuration is the following:
    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>
    where CustomExceptionResolver is a subclass of SimpleMappingExceptionResolver.

    When I access a non-exisiting page, I get the following error:
    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
    I thought this would be caught by the SimpleMappingExceptionResolver, but apparently it isn't.

    Anybody has any idea how to capture this exception gracefully in Spring and redirect to some other page?

    Cheers, bo
Working...
X