Polish
This commit is contained in:
@@ -41,7 +41,8 @@ public class SampleSecureApplication implements CommandLineRunner {
|
||||
.commaSeparatedStringToAuthorityList("ROLE_USER")));
|
||||
try {
|
||||
System.out.println(service.secure());
|
||||
} finally {
|
||||
}
|
||||
finally {
|
||||
SecurityContextHolder.clearContext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,11 +22,11 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class SampleService {
|
||||
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
public String secure() {
|
||||
return "Hello Security";
|
||||
|
||||
@@ -51,7 +51,7 @@ public class SampleServletApplication extends SpringBootServletInitializer {
|
||||
public static void main(String[] args) throws Exception {
|
||||
SpringApplication.run(SampleServletApplication.class, args);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
return application.sources(SampleServletApplication.class);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<include resource="org/springframework/boot/logging/logback/base.xml"/>
|
||||
|
||||
<include resource="org/springframework/boot/logging/logback/base.xml"/>
|
||||
|
||||
<!-- logger name="org.springframework" level="DEBUG"/-->
|
||||
|
||||
|
||||
</configuration>
|
||||
|
||||
Reference in New Issue
Block a user