我是Spring Security的新手,並且在Spring MVC應用程序中配置了Spring Security。Spring Security登錄問題
提交登錄頁面後,我收到以下錯誤
The requested resource (/j_spring_security_check) is not available.
我無法理解這種行爲。
請幫助。
彈簧security.xml文件
<security:http auto-config="true" use-expressions="true" access-denied-page="/appln/denied">
<security:intercept-url pattern="/appln/login" access="permitAll" />
<security:intercept-url pattern="/appln/index" access="hasRole('ROLE_ADMIN')" />
<security:intercept-url pattern="/appln/run" access="hasRole('ROLE_ADMIN')" />
<security:intercept-url pattern="/appln/common" access="hasRole('ROLE_USER')" />
<security:form-login login-page="/appln/login"
authentication-failure-url="/appln/login?error=true"
default-target-url="/appln/run"
authentication-success-handler-ref="AuthHandlr" />
<security:logout invalidate-session="true"
logout-success-url="/appln/login"
delete-cookies="JSESSIONID" />
</security:http>
的web.xml
<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>
</filter-mapping>
<servlet>
<servlet-name>servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
彈簧安全配置片段(以及相關的web.xml一個)將真正幫助。 –
你檢查了你的日誌文件嗎?該消息通常表明服務器沒有乾淨地啓動。某處應該有一個日誌錯誤/堆棧跟蹤。 –