title: How to redirect to access-denied-page with spring security
body: <p>I have an application with JSF+Spring.
  I am using spring security and i works properly.However when i try to reach a secured page without authentication,instead of redirecting me to the denied page i just shows 403 Forbidden page.
  I don't know if there is anyting missing on applicationContext or web.xml,here is my code:</p>
  
  <p>part of applicationContext:</p>
  
  <pre><code>&lt;sec:http access-denied-page="/denied.xhtml"  auto-config="true" use-expressions="false" &gt;
      &lt;sec:form-login login-page="/login.xhtml" default-target-url="/"   authentication-failure-url="/denied.xhtml"
      login-processing-url="/static/j_spring_security_check"
      /&gt;
      &lt;sec:intercept-url pattern="/PANEL/**"  access="ROLE_GENERALT"&gt;&lt;/sec:intercept-url&gt;
      &lt;sec:logout invalidate-session="true" logout-url="/index.xhtml"/&gt;
      &lt;/sec:http&gt;
  
  &lt;sec:global-method-security secured-annotations="enabled" jsr250-annotations="enabled"&gt;&lt;/sec:global-method-security&gt;
  </code></pre>
  
  <p>and web.xml:</p>
  
  <pre><code>    &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;classpath:/appContext.xml
          &lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;filter&gt;
      &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
      &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
  
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
    &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
    &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
    &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
  &lt;/filter-mapping&gt;
  </code></pre>