Defining a common WebContentInterceptor
In this recipe, we will highlight how we have implemented a
WebContentInterceptor superclass for Controllers.
We are about to present a Controller superclass having the specificity of being registered as a
WebContentInterceptor. This superclass allows us to globally control sessions and to manage caching options.
It will help us understanding the request lifecycle throughout the Framework and through other potential interceptors.
How to do it...
- Registering a default
WebContentInterceptorwith its specific configuration can be done entirely with the configuration approach:
<mvc:interceptors> <bean id="webContentInterceptor" class="org.sfw.web.servlet.mvc.WebContentInterc eptor"> <property name="cacheSeconds" ...