Commit d639763b authored by Dave Syer's avatar Dave Syer

Another attempt at making the ui sample work

parent db27620c
...@@ -205,6 +205,7 @@ ...@@ -205,6 +205,7 @@
<systemPropertyVariables> <systemPropertyVariables>
<java.security.egd>file:/dev/./urandom</java.security.egd> <java.security.egd>file:/dev/./urandom</java.security.egd>
</systemPropertyVariables> </systemPropertyVariables>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
......
...@@ -11,30 +11,25 @@ class Example { ...@@ -11,30 +11,25 @@ class Example {
model.putAll([title: "My Page", date: new Date(), message: "Hello World"]) model.putAll([title: "My Page", date: new Date(), message: "Hello World"])
return "home"; return "home";
} }
} }
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
@Configuration @Configuration
@Log @Log
class MvcConfiguration extends WebMvcConfigurerAdapter { class MvcConfiguration extends WebMvcConfigurerAdapter {
@Override @Override
void addInterceptors(InterceptorRegistry registry) { void addInterceptors(InterceptorRegistry registry) {
log.info("Registering interceptor") log.info "Registering interceptor"
registry.addInterceptor(interceptor()) registry.addInterceptor(interceptor())
} }
@Bean @Bean
HandlerInterceptor interceptor() { HandlerInterceptor interceptor() {
log.info("Creating interceptor") log.info "Creating interceptor"
new HandlerInterceptorAdapter() { [
@Override postHandle: { request, response, handler, mav ->
void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView mav) { log.info "Intercepted: model=" + mav.model
log.info("Model: " + mav.model) }
} ] as HandlerInterceptorAdapter
} }
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment