Do you really want to map the root path, or did you mean '/ *'? Anyway, the following configuration works for me using Spring 3.1.1, DispatcherServlet maps to root ('/') in web.xml:
<mvc:annotation-driven/> <mvc:default-servlet-handler/> <mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/"/> <bean class="de.scrappy.web.TestInterceptor"/> </mvc:interceptor> </mvc:interceptors>
What version of Spring are you using and what does the Spring DispatcherServlet look like? And note that TestInterceptor implements HandlerInterceptor , I don't know if WebRequestInterceptors handled differently.
Robin source share