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: `
<c:import context="/webapp1" url="/myurl" />`.
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`
Seems like Spring is not ready for cross context request processing (at least not without a bit of hacking).
FrameworkServlet always tries to get
WebAsyncManager from the request attributes. And the way it is extracted can not work across different contexts (class loaders).
I see two possibilities how to workaround this:
includeJSP tag, which will wrap the original request so that Spring specific attributes are not visible (usually the ones starting with
org.springframework) to the second context.