乍一看你的网址模式是错误的。 url-pattern是一种蚂蚁风格的模式(默认模式,如中所述) Spring安全参考指南 ) 意思就是
你正在使用/ *而你可能应该使用/ **
<http auto-config="true"> <intercept-url pattern="/**" access="ROLE_ADMIN"/> <form-login login-processing-url="/j_spring_security_check" login-page="/views/login.xhtml" default-target-url="/views/index.xhtml" authentication-failure-url="/views/error.xhtml" /> </http>
有关蚂蚁风格表达的更多信息,请参阅此内容 题 。