I have a Spring HandlerInterceptor intercepting the interface URL in my application (/ app / *). I want to determine which action method in the handler should be called from the HandlerInterceptor. Is there any way to look at this, do I need to inject something into the interceptor, which might look like this based on the requested path?
The interceptor is as follows:
public class PageCacheInterceptor implements HandlerInterceptor {...}
It is displayed as follows:
<mvc:interceptors>
<bean class="com.example.web.interceptors.PageCacheInterceptor" />
</mvc:interceptors>
Background (because I know what you ask!). I am adding simple page caching to my application and want to use annotation like @Cacheable for every suitable method in the controller. The interceptor can then determine if the response should be cached based on the action that created it.
For instance:
@RequestMapping(value = "", method = RequestMethod.GET)
@Cacheable(events={Events.NEW_ORDER,Events.NEW_STAT})
public String home(Model model) {...}
- , . , /widget/list , .
: Spring 3.1 M2, , , , . - HandlerMethod ?