I want to use the cross context feature in a Spring application so I can import some webapp1 JSP into a webapp2 JSP. I’m using Eclipse STS with the included Tomcat 7.0.42 (vFabric TC Server) and Spring Framework 3.2.8.
I have configured the Tomcat conf/context.xml to have: `
In the webapp2 JSP I use `
When I call the webapp2 JSP I have this error:
HTTP Status 500 - javax.servlet.ServletException: javax.servlet.jsp.JspException: `java.lang.ClassCastException:` `org.springframework.web.context.request.async.WebAsyncManager cannot be cast to` org.springframework.web.context.request.async.WebAsyncManager`
Has anyone else encountered this?
Seems like Spring is not ready for cross context request processing (at least not without a bit of hacking).
always tries to get
from the request attributes. And the way it is extracted can not work across different contexts
I see two possibilities how to workaround this:
Implement your own
JSP tag, which will wrap the original request so that Spring specific attributes are not visible (usually the ones starting with
) to the second context.
- Put Spring JARs in a shared class loader path (that would be probably the easier way).