Change package names zero->boot
* actuator -> boot-ops * cli -> boot-cli * launcher -> boot-load * autoconfig -> boot-config * bootstrap -> boot-strap * starters -> boot-up [#54095231] [bs-253] Refactor Zero->Boot
This commit is contained in:
35
spring-boot-cli/samples/ui.groovy
Normal file
35
spring-boot-cli/samples/ui.groovy
Normal file
@@ -0,0 +1,35 @@
|
||||
package app
|
||||
|
||||
import groovy.util.logging.Log
|
||||
|
||||
@Grab("org.thymeleaf:thymeleaf-spring3:2.0.16")
|
||||
@Controller
|
||||
class Example {
|
||||
|
||||
@RequestMapping("/")
|
||||
public String helloWorld(Map<String,Object> model) {
|
||||
model.putAll([title: "My Page", date: new Date(), message: "Hello World"])
|
||||
return "home";
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@Log
|
||||
class MvcConfiguration extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
void addInterceptors(InterceptorRegistry registry) {
|
||||
log.info "Registering interceptor"
|
||||
registry.addInterceptor(interceptor())
|
||||
}
|
||||
|
||||
@Bean
|
||||
HandlerInterceptor interceptor() {
|
||||
log.info "Creating interceptor"
|
||||
[
|
||||
postHandle: { request, response, handler, mav ->
|
||||
log.info "Intercepted: model=" + mav.model
|
||||
}
|
||||
] as HandlerInterceptorAdapter
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user