刚接触spring-security,按照文档上的做最小配置,基本配置如下:
web.xml
<!-- 权限 Spring Security的权限过滤-->
<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>
spring-security.xml配置
<debug />
<global-method-security pre-post-annotations="enabled" />
<http pattern="/common/**" security="none" />
<http pattern="/resources/**" security="none" />
<http pattern="/home/login" security="none" />
<http pattern="login.html" security="none" />
我的登录页面是由spring Controller跳转到web-inf文件夹下的login.html登录页面
我开始怀疑是配置问题,后来试试访问 http://xxxx:8099/resource下的资源文件,是能正确过滤掉不拦截,
但是在使用登录页面请求的url时 http://xxxx:8099/home/login 一直是404
spring mvc Controller代码是
@Controller
@RequestMapping("/home")
public class WelcomeController {
@RequestMapping("/login")
public String index(){
return "login.html";
}
}
请问下问题出在什么地方?