Boa tarde a todos, gostaria de colocar minha index.xhtml, produto.xhtml e carrinho.xhtml acessivel para todos os usuarios logados ou nao, porem o pagamento.xhtml acessivel apenas para usuarios logados…
Meu codigo está abaixo porém nao funciona…
@Override
protected void configure(HttpSecurity http) throws Exception {http .authorizeRequests() .antMatchers("/**", "/carrinho.xhtml" , "/produto.xhtml","index.html").permitAll() .anyRequest().authenticated() .antMatchers("/pagamento.xhtml").hasRole("USER") .and() .formLogin().loginPage("/login.xhtml").permitAll() .and().logout().logoutSuccessUrl("/index.xhtml");
}