org.apache.catalina.core.ApplicationHttpRequest does not override one of the Servlet 3.0 APIs, javax.servlet.ServletRequestWrapper#getServletContext(). So ApplicationHttpRequest.getServletContext() does not return its mapped ServletContext in the crossContext situation.
Thanks for the report. This has been fixed in 8.0.x for 8.0.10 onwards and in 7.0.x for 7.0.55 onwards.
I believe this update may have broken cross-context request dispatching in JSTL calls in JSP. I'm running Fedora 21, and the previous distro Tomcat version was 7.0.54, and my cross-context includes worked fine (I've downgraded from the current Fedora distro to confirm this). The recently-updated distro Tomcat is version 7.0.59, and now my cross-context includes throw the following fatal exception trace: javax.servlet.jsp.JspTagException: Unable to get RequestDispatcher for Context: "/" and URL: "/calendar.jsp?nid=0&pid=185&layoutpane_id=7&cid=276&accessuser=". Verify values and/or enable cross context access. org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:278) org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161) org.apache.jsp.index_jsp._jspService(index_jsp.java:3021) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745)
I'm pretty darned sure JSTL includes are broken in 7.0.59, or there's a change that I need to know about to make them work again. It seems very likely that this update is the one responsible.
The current version of Tomcat 7 is 7.0.61.
Ahh, then I'll wait until Tomcat 7.0.61 appears in the FC 21 distro to check that this has been fixed. I'm sticking with the distro versions on these servers for ease of maintenance reasons. Fedora is usually pretty quick. Cheers!
I'm happy to report that this is indeed resolved in 7.0.62. Fedora 22 is still sitting on 7.0.59 (with the bug), but hopefully a tomcat update will reach the updates distro soon. Thanks!