2
私はJSF + Springでアプリケーションを持っています。 私は春のセキュリティを使用しており、私は正しく動作します。認証されていないページにアクセスしようとすると、拒否されたページにリダイレクトするのではなく、403禁止ページが表示されます。 ApplicationContextのの春のセキュリティでアクセス拒否ページにリダイレクトする方法
一部:
<sec:http access-denied-page="/denied.xhtml" auto-config="true" use-expressions="false" >
<sec:form-login login-page="/login.xhtml" default-target-url="/" authentication-failure-url="/denied.xhtml"
login-processing-url="/static/j_spring_security_check"
/>
<sec:intercept-url pattern="/PANEL/**" access="ROLE_GENERALT"></sec:intercept-url>
<sec:logout invalidate-session="true" logout-url="/index.xhtml"/>
</sec:http>
<sec:global-method-security secured-annotations="enabled" jsr250-annotations="enabled"></sec:global-method-security>
とweb.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/appContext.xml
</param-value>
</context-param>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>