Defining a common WebContentInterceptor

In this recipe, we will highlight how we have implemented a WebContentInterceptor superclass for Controllers.

Getting ready

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...

  1. Registering a default WebContentInterceptor with 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" ...

Get Spring MVC: Designing Real-World Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.