Spring Web Security许可索引页面

时间:2018-02-21 08:50:05

标签: java spring-security

我想允许匿名访问我的索引页面,这意味着该网址可以是localhost:8080/MyProject/localhost:8080/MyProject/index.xhtml。我已阅读this但案例与我的不同。我尝试将其配置为:<>

http.authorizeRequests().antMatchers("/javax.faces.resource/**", "/", "/index.xhtml").permitAll().anyRequest().authenticated();

通过上述声明,网址localhost:8080/MyProject/index.xhtml将允许匿名访问,但localhost:8080/MyProject/仍将拒绝访问。帮助

0 个答案:

没有答案