November 2017
Intermediate to advanced
542 pages
14h 24m
English
Spring itself provides a simpler annotation style that is similar to the JSR-250 @RolesAllowed annotation. The @Secured annotation is functionally and syntactically the same as @RolesAllowed. The only notable differences are that it does not require the external dependency, cannot be processed by other frameworks, and the processing of these annotations must be explicitly enabled with another attribute on the @EnableGlobalMethodSecurity annotation:
//src/main/java/com/packtpub/springsecurity/configuration/SecurityConfig.java @EnableWebSecurity(debug = true) @EnableGlobalMethodSecurity(securedEnabled=true) public class SecurityConfig extends WebSecurityConfigurerAdapter {
As @Secured functions ...
Read now
Unlock full access