Relocate projects to spring-boot-project
Move projects to better reflect the way that Spring Boot is released. The following projects are under `spring-boot-project`: - `spring-boot` - `spring-boot-autoconfigure` - `spring-boot-tools` - `spring-boot-starters` - `spring-boot-actuator` - `spring-boot-actuator-autoconfigure` - `spring-boot-test` - `spring-boot-test-autoconfigure` - `spring-boot-devtools` - `spring-boot-cli` - `spring-boot-docs` See gh-9316
This commit is contained in:
33
spring-boot-project/spring-boot-cli/samples/ui.groovy
Normal file
33
spring-boot-project/spring-boot-cli/samples/ui.groovy
Normal file
@@ -0,0 +1,33 @@
|
||||
package app
|
||||
|
||||
@Grab("thymeleaf-spring5")
|
||||
@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