I figured it out by looking at some more examples and the Spring documentation. Thanks for your advice!
Type: Posts; User: pdedecker; Keyword(s):
I figured it out by looking at some more examples and the Spring documentation. Thanks for your advice!
I want to define multiple mvc:mappings for a HandlerInterceptor. I tried doing this:
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/home*"/>
...
You're right, I accidentally imported org.springframework.web.portlet.handler.HandlerInterceptorAdapter instead of org.springframework.web.servlet.handler.HandlerInterceptorAdapter... d'oh. Still...
Apparently javax.portlet isn't a default part of the servlet API, so I downloaded http://repository.jboss.org/portlet/2.0-Draft32/lib/portlet-api.jar. I still can't access the session-scoped object...
Here's the full stack trace.
Exception
javax.servlet.ServletException: Servlet.init() for servlet dispatcher threw exception...
I downloaded an example of a project that uses HandlerInterceptor for this. Here's what I came up with...
I added this to dispatcher-servlet.xml.
<bean id="sessionBeanInserter"...
I'm looking at RequestContextUtils.getWebApplicationContext(ServletRequest request) and WebApplicationContext.getBeansOfType(Class<T> type) to do the job. Is this a good way to do it? If not, can you...
I have configured a session-scoped bean in my dispatcher config:
<bean id="mySessionScopedBean" class="net.sandbox.pojos.MySessionScopedBean" scope="session">
<aop:scoped-proxy />
</bean>...