Author: markt
Date: Fri Jul 4 20:30:29 2014
New Revision: 1607934
URL: http://svn.apache.org/r1607934
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56677
Ensure that HttpServletRequest.getServletContext() returns the correct value
during a cross-context dispatch.
Modified:
tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java?rev=1607934&r1=1607933&r2=1607934&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java Fri
Jul 4 20:30:29 2014
@@ -30,6 +30,7 @@ import java.util.NoSuchElementException;
import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpSession;
@@ -188,6 +189,14 @@ class ApplicationHttpRequest extends Htt
// ------------------------------------------------- ServletRequest Methods
+ @Override
+ public ServletContext getServletContext() {
+ if (context == null) {
+ return null;
+ }
+ return context.getServletContext();
+ }
+
/**
* Override the <code>getAttribute()</code> method of the wrapped request.
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1607934&r1=1607933&r2=1607934&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Jul 4 20:30:29 2014
@@ -101,6 +101,11 @@
(markt)
</fix>
<fix>
+ <bug>56677</bug>: Ensure that
+ <code>HttpServletRequest.getServletContext()</code> returns the correct
+ value during a cross-context dispatch. (markt)
+ </fix>
+ <fix>
<bug>56693</bug>: Fix various issues in the static resource cache
implementation where the cache retained a stale entry after the
successful completion of an operation that always invalidates the cache
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]