Announcement Announcement Module
Collapse
No announcement yet.
Access denied error intercepted as 404 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Access denied error intercepted as 404

    I have configured Spring Security for, in case of access denied, redirect to a certain error page. Today I implemented generic error handling for all types of errors on my controller and now the access denied is one of those. I need to exclude access denied error but I don't know how.

    securityContext.xml
    Code:
    <http use-expressions="true">
        <form-login login-page="/login.jsp" default-target-url="/" authentication-failure-url="/login.jsp?login_error=1"/>
        <access-denied-handler error-page="/accessDenied.jsp"/>
        <!-- .. some more configs .. -->
    </http>
    servletContext.xml
    Code:
    	
    <bean id="simpleMappingExceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
        <property name="defaultErrorView" value="internalError"/>
    </bean>
    So when I should be redirected to /accessDenied.jsp I'm sent to internalError.jsp.

  • #2
    hey Wencha,
    you need to look at the doc,which clearly tells that
    If an AccessDeniedException is thrown and a user has already been authenticated, then this means that an operation has been attempted for which they don't have enough permissions.

    Comment

    Working...
    X