portletmvc4spring
portletmvc4spring copied to clipboard
Spring Interceptors are not being invoked with PortletMVC4Spring
Hi @ngriffin7a and Team,
I am trying to implement basic authentication using Spring REST with Liferay 7 (portletmvc4spring) where I have extended the Spring interceptor HandlerInterceptorAdapter and provided in main application context xml as follows:
<mvc:interceptors> <mvc:interceptor> <!-- <mvc:mapping path="/user/authenticate"/> --> <mvc:mapping path="/test/**"/> <mvc:mapping path="/ping/**"/> <mvc:mapping path="/secured/**"/> <mvc:mapping path="/**"/> <bean class="portlet1.interceptor.SecureRequestHandlerInterceptor"></bean> </mvc:interceptor> </mvc:interceptors>
However, the interceptor is not being invoked. I am attaching the sample project for the same. Can you please help with this this.
com.liferay.test.portletmvc4spring.portlet.zip
Thanks in advance. -Dipak Ahuja
Hello, try to add <mvc:annotation-driven />in portlet-application-context.xml, it should do the trick. Without it, many Spring MVC features won't work.