以下代码无效
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.anonymous()
.authorities("ROLE_ANONYMOUS").and()
.authorizeRequests()
.antMatchers(
"/","/login**", "/webjars*", "/static*",
"/profile/register**","/user/IsRegistered**","/profile/save**","/topic/zone*//**","/topic**","/topic/getTopicList**","/topic/detail**","/topic/getOne*//**","/topic/getCommentList**","/topic/saveTopicComment**").permitAll()
.anyRequest()
.authenticated().
and().formLogin().loginPage("/login").failureUrl("/login?error").defaultSuccessUrl("/topic/zone")
.and().exceptionHandling()
.and().logout().logoutUrl("/logout").invalidateHttpSession(true).logoutSuccessUrl("/login")
.and()
.csrf()
.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse());
// http.addFilterAfter(tokenFilter(), BasicAuthenticationFilter.class);
http.csrf().disable();
http.headers().frameOptions().sameOrigin();
}
@Slf4j
@Controller("chatController")
@RequestMapping(value="/chat")
public class IndexController extends AbstractController {
@Secured( value={"ROLE_ANONYMOUS"})
@RequestMapping(value="")
public String index(Model model){
super.setUser(model);
return "chat/index";
}
}
我这也是,怎么解决