Bug 56677 - ApplicationHttpRequest does not override javax.servlet.ServletRequestWrapper#getServletContext()
ApplicationHttpRequest does not override javax.servlet.ServletRequestWrapper#...
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Servlet & JSP API
trunk
PC Linux
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2014-06-27 05:56 UTC by Eugene Chung (TmaxSoft)
Modified: 2015-06-23 22:01 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Chung (TmaxSoft) 2014-06-27 05:56:06 UTC
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.
Comment 1 Mark Thomas 2014-07-04 20:33:38 UTC
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.
Comment 2 Sam Hokin 2015-03-29 16:18:12 UTC
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)
Comment 3 Sam Hokin 2015-04-16 13:23:18 UTC
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.
Comment 4 Konstantin Kolinko 2015-04-16 13:40:51 UTC
The current version of Tomcat 7 is 7.0.61.
Comment 5 Sam Hokin 2015-04-21 00:41:24 UTC
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!
Comment 6 Sam Hokin 2015-06-23 22:01:40 UTC
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!