spring MVC与spring Security整合的问题

 配置文件:
---
web.mxl
spring security
<filter-mapping>
        <filter-name>securityFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    spring mvc
<servlet-mapping>
        <servlet-name>springMVC</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

spring配置文件
<security:http pattern="/login.do" security="none" />
<security:http auto-config='false' access-decision-manager-ref="accessDecisionManager"  entry-point-ref="authenticationEntryPoint" use-expressions="false" name="mainFilterChain">
<security:intercept-url pattern="/login.do" access="IS_AUTHENTICATED_ANONYMOUSLY" />
 <bean id="authenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint">
         <constructor-arg name="loginFormUrl" value="/login.do" />
    </bean>
Controller

@RequestMapping(value= "/login", method = RequestMethod.GET)
public String doLogin(){
    System.out.println("我要登录");
    return "login";
}
在前台做一次登录为什么会重定向两次,也就是走了两遍doLogin()方法
查看全部
youyuanlv
游荡的代码
2017/07/03 09:33
  • spring
  • login
  • 点赞
  • 收藏
  • 回答
    私信

1个回复