JBossWeb SVN: r1617 - in branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina: core and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: mmillson
Date: 2010-12-09 13:36:36 -0500 (Thu, 09 Dec 2010)
New Revision: 1617
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/connector/Response.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/StandardHostValve.java
Log:
Allow extra response headers to be sent with a custom error page for [JBPAPP-5559].
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/connector/Response.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/connector/Response.java 2010-12-09 15:17:37 UTC (rev 1616)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/connector/Response.java 2010-12-09 18:36:36 UTC (rev 1617)
@@ -675,6 +675,30 @@
/**
+ * Reset the data buffer and the using Writer/Stream flags but not any
+ * status or header information.
+ *
+ * @param resetWriterStreamFlags <code>true</code> if the internal
+ * <code>usingWriter</code>, <code>usingOutputStream</code>,
+ * <code>isCharacterEncodingSet</code> flags should also be reset
+ *
+ * @exception IllegalStateException if the response has already
+ * been committed
+ */
+ public void resetBuffer(boolean resetWriterStreamFlags) {
+
+ resetBuffer();
+
+ if(resetWriterStreamFlags) {
+ usingOutputStream = false;
+ usingWriter = false;
+ isCharacterEncodingSet = false;
+ }
+
+ }
+
+
+ /**
* Set the buffer size to be used for this Response.
*
* @param size The new buffer size
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/StandardHostValve.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/StandardHostValve.java 2010-12-09 15:17:37 UTC (rev 1616)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/StandardHostValve.java 2010-12-09 18:36:36 UTC (rev 1617)
@@ -368,7 +368,7 @@
if (exception == null)
return (null);
- Class clazz = exception.getClass();
+ Class<?> clazz = exception.getClass();
String name = clazz.getName();
while (!Object.class.equals(clazz)) {
ErrorPage errorPage = context.findErrorPage(name);
@@ -406,15 +406,8 @@
try {
- // Reset the response if possible (else IllegalStateException)
- //hres.reset();
// Reset the response (keeping the real error code and message)
- Integer statusCodeObj =
- (Integer) request.getAttribute(Globals.STATUS_CODE_ATTR);
- int statusCode = statusCodeObj.intValue();
- String message =
- (String) request.getAttribute(Globals.ERROR_MESSAGE_ATTR);
- response.reset(statusCode, message);
+ response.resetBuffer(true);
// Forward control to the specified location
ServletContext servletContext =
14 years
JBossWeb SVN: r1616 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-12-09 10:17:37 -0500 (Thu, 09 Dec 2010)
New Revision: 1616
Added:
tags/JBOSSWEB_7_0_0_BETA1/
Log:
- Web 7.0.0.Beta1.
Copied: tags/JBOSSWEB_7_0_0_BETA1 (from rev 1615, trunk)
14 years
JBossWeb SVN: r1615 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-12-09 09:12:06 -0500 (Thu, 09 Dec 2010)
New Revision: 1615
Added:
tags/JBOSSWEB_3_0_0_CR1/
Log:
- Web 3.0.0 CR1.
Copied: tags/JBOSSWEB_3_0_0_CR1 (from rev 1614, branches/3.0.x)
14 years
JBossWeb SVN: r1613 - branches/3.0.x/webapps/docs.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-12-09 07:56:33 -0500 (Thu, 09 Dec 2010)
New Revision: 1613
Modified:
branches/3.0.x/webapps/docs/changelog.xml
Log:
- CR1 first.
Modified: branches/3.0.x/webapps/docs/changelog.xml
===================================================================
--- branches/3.0.x/webapps/docs/changelog.xml 2010-12-09 10:11:51 UTC (rev 1612)
+++ branches/3.0.x/webapps/docs/changelog.xml 2010-12-09 12:56:33 UTC (rev 1613)
@@ -16,7 +16,7 @@
<body>
-<section name="JBoss Web 3.0.0.Final (remm)">
+<section name="JBoss Web 3.0.0.CR1 (remm)">
<subsection name="Catalina">
<changelog>
<fix>
14 years
JBossWeb SVN: r1612 - in branches/3.0.x: java/org/apache/coyote/ajp and 4 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-12-09 05:11:51 -0500 (Thu, 09 Dec 2010)
New Revision: 1612
Modified:
branches/3.0.x/java/org/apache/coyote/Constants.java
branches/3.0.x/java/org/apache/coyote/ajp/AjpAprProtocol.java
branches/3.0.x/java/org/apache/coyote/ajp/AjpProtocol.java
branches/3.0.x/java/org/apache/coyote/http11/Http11AprProtocol.java
branches/3.0.x/java/org/apache/coyote/http11/Http11Protocol.java
branches/3.0.x/java/org/apache/naming/resources/ProxyDirContext.java
branches/3.0.x/java/org/jboss/web/rewrite/TomcatResolver.java
branches/3.0.x/webapps/docs/changelog.xml
Log:
- Add back 3 patches to 3.0.
Modified: branches/3.0.x/java/org/apache/coyote/Constants.java
===================================================================
--- branches/3.0.x/java/org/apache/coyote/Constants.java 2010-12-09 10:09:24 UTC (rev 1611)
+++ branches/3.0.x/java/org/apache/coyote/Constants.java 2010-12-09 10:11:51 UTC (rev 1612)
@@ -68,4 +68,7 @@
"org.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER",
"false")).booleanValue();
+ public static final int MAX_PAUSE_WAIT =
+ Integer.valueOf(System.getProperty("org.apache.coyote.MAX_PAUSE_WAIT", "60")).intValue();
+
}
Modified: branches/3.0.x/java/org/apache/coyote/ajp/AjpAprProtocol.java
===================================================================
--- branches/3.0.x/java/org/apache/coyote/ajp/AjpAprProtocol.java 2010-12-09 10:09:24 UTC (rev 1611)
+++ branches/3.0.x/java/org/apache/coyote/ajp/AjpAprProtocol.java 2010-12-09 10:11:51 UTC (rev 1612)
@@ -210,12 +210,13 @@
log.error(sm.getString("ajpprotocol.endpoint.pauseerror"), ex);
throw ex;
}
- // Wait for a while until all the processors are idle
+ // Wait for a while until all the processors are no longer processing requests
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
+ done = true;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
try {
@@ -223,10 +224,10 @@
} catch (InterruptedException e) {
;
}
- continue;
+ done = false;
+ break;
}
}
- done = true;
}
if (log.isInfoEnabled())
log.info(sm.getString("ajpprotocol.pause", getName()));
Modified: branches/3.0.x/java/org/apache/coyote/ajp/AjpProtocol.java
===================================================================
--- branches/3.0.x/java/org/apache/coyote/ajp/AjpProtocol.java 2010-12-09 10:09:24 UTC (rev 1611)
+++ branches/3.0.x/java/org/apache/coyote/ajp/AjpProtocol.java 2010-12-09 10:11:51 UTC (rev 1612)
@@ -210,12 +210,13 @@
log.error(sm.getString("ajpprotocol.endpoint.pauseerror"), ex);
throw ex;
}
- // Wait for a while until all the processors are idle
+ // Wait for a while until all the processors are no longer processing requests
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
+ done = true;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
try {
@@ -223,10 +224,10 @@
} catch (InterruptedException e) {
;
}
- continue;
+ done = false;
+ break;
}
}
- done = true;
}
if (log.isInfoEnabled())
log.info(sm.getString("ajpprotocol.pause", getName()));
Modified: branches/3.0.x/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- branches/3.0.x/java/org/apache/coyote/http11/Http11AprProtocol.java 2010-12-09 10:09:24 UTC (rev 1611)
+++ branches/3.0.x/java/org/apache/coyote/http11/Http11AprProtocol.java 2010-12-09 10:11:51 UTC (rev 1612)
@@ -158,12 +158,13 @@
log.error(sm.getString("http11protocol.endpoint.pauseerror"), ex);
throw ex;
}
- // Wait for a while until all the processors are idle
+ // Wait for a while until all the processors are no longer processing requests
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
+ done = true;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
try {
@@ -171,10 +172,10 @@
} catch (InterruptedException e) {
;
}
- continue;
+ done = false;
+ break;
}
}
- done = true;
}
if(log.isInfoEnabled())
log.info(sm.getString("http11protocol.pause", getName()));
Modified: branches/3.0.x/java/org/apache/coyote/http11/Http11Protocol.java
===================================================================
--- branches/3.0.x/java/org/apache/coyote/http11/Http11Protocol.java 2010-12-09 10:09:24 UTC (rev 1611)
+++ branches/3.0.x/java/org/apache/coyote/http11/Http11Protocol.java 2010-12-09 10:11:51 UTC (rev 1612)
@@ -230,8 +230,9 @@
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
+ done = true;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
try {
@@ -239,10 +240,10 @@
} catch (InterruptedException e) {
;
}
- continue;
+ done = false;
+ break;
}
}
- done = true;
}
if (log.isInfoEnabled())
log.info(sm.getString("http11protocol.pause", getName()));
Modified: branches/3.0.x/java/org/apache/naming/resources/ProxyDirContext.java
===================================================================
--- branches/3.0.x/java/org/apache/naming/resources/ProxyDirContext.java 2010-12-09 10:09:24 UTC (rev 1611)
+++ branches/3.0.x/java/org/apache/naming/resources/ProxyDirContext.java 2010-12-09 10:11:51 UTC (rev 1612)
@@ -1686,7 +1686,7 @@
if (((!entry.exists)
|| (entry.context != null)
|| ((entry.resource != null)
- && (entry.resource.getContent() != null)))
+ && (entry.resource.getContent() != null || entry.timestamp == Long.MAX_VALUE)))
&& (System.currentTimeMillis() < entry.timestamp)) {
return true;
}
Modified: branches/3.0.x/java/org/jboss/web/rewrite/TomcatResolver.java
===================================================================
--- branches/3.0.x/java/org/jboss/web/rewrite/TomcatResolver.java 2010-12-09 10:09:24 UTC (rev 1611)
+++ branches/3.0.x/java/org/jboss/web/rewrite/TomcatResolver.java 2010-12-09 10:11:51 UTC (rev 1612)
@@ -132,7 +132,8 @@
}
public String resolveEnv(String key) {
- return System.getProperty(key);
+ Object result = request.getAttribute(key);
+ return (result != null) ? result.toString() : System.getProperty(key);
}
public String resolveSsl(String key) {
Modified: branches/3.0.x/webapps/docs/changelog.xml
===================================================================
--- branches/3.0.x/webapps/docs/changelog.xml 2010-12-09 10:09:24 UTC (rev 1611)
+++ branches/3.0.x/webapps/docs/changelog.xml 2010-12-09 10:11:51 UTC (rev 1612)
@@ -16,6 +16,26 @@
<body>
+<section name="JBoss Web 3.0.0.Final (remm)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ <jira>189</jira>: Overlay timestamps need special treatment. (remm)
+ </fix>
+ <fix>
+ <jira>190</jira>: The rewrite resolver should look at request attributes. (remm)
+ </fix>
+ </changelog>
+ </subsection>
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ <jira>186</jira>: Fix wait logic in pause() and add configuration. (jfclere)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
+
<section name="JBoss Web 3.0.0.Beta7 (remm)">
<subsection name="Genral">
<changelog>
14 years
JBossWeb SVN: r1611 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-12-09 05:09:24 -0500 (Thu, 09 Dec 2010)
New Revision: 1611
Modified:
trunk/build.properties.default
trunk/build.xml
trunk/webapps/docs/changelog.xml
Log:
- Update version number to 7.0, for AS 7.
Modified: trunk/build.properties.default
===================================================================
--- trunk/build.properties.default 2010-12-09 09:17:27 UTC (rev 1610)
+++ trunk/build.properties.default 2010-12-09 10:09:24 UTC (rev 1611)
@@ -10,7 +10,7 @@
# -----------------------------------------------------------------------------
# ----- Version Control Flags -----
-version.major=3
+version.major=7
version.minor=0
version.build=0
version.patch=0
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2010-12-09 09:17:27 UTC (rev 1610)
+++ trunk/build.xml 2010-12-09 10:09:24 UTC (rev 1611)
@@ -13,12 +13,12 @@
<!-- Project Properties -->
<property name="name" value="JBoss Web" />
<property name="year" value="2010" />
- <property name="version.major" value="3" />
+ <property name="version.major" value="7" />
<property name="version.minor" value="0" />
<property name="version.build" value="0" />
<property name="version.patch" value="0" />
<property name="version.tag" value="SNAPSHOT" />
- <property name="version" value="${version.major}.${version.minor}.${version.build}-${version.tag}" />
+ <property name="version" value="${version.major}.${version.minor}.${version.build}.${version.tag}" />
<property name="version.number" value="${version.major}.${version.minor}.${version.build}.${version.patch}" />
<property name="project" value="jboss-web" />
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-12-09 09:17:27 UTC (rev 1610)
+++ trunk/webapps/docs/changelog.xml 2010-12-09 10:09:24 UTC (rev 1611)
@@ -16,29 +16,10 @@
<body>
-<section name="JBoss Web 3.0.0.Beta9 (remm)">
+<section name="JBoss Web 7.0.0.Beta1 (remm)">
<subsection name="Catalina">
<changelog>
<fix>
- <bug>49991</bug>: Fix calling Request listeners when entering and exiting
- the application scope in the main host valve, not simply just before
- calling the filter chain. (remm)
- </fix>
- </changelog>
- </subsection>
- <subsection name="Jasper">
- <changelog>
- <fix>
- Close reader in JDT compiler. (markt)
- </fix>
- </changelog>
- </subsection>
-</section>
-
-<section name="JBoss Web 3.0.0.Beta8 (remm)">
- <subsection name="Catalina">
- <changelog>
- <fix>
<jboss-jira>JBAS-8571</jboss-jira>: Allow a Servlet 3.0 login to reauthenticate with SSO. (remm)
</fix>
<fix>
@@ -56,6 +37,11 @@
<fix>
<jira>190</jira>: The rewrite resolver should look at request attributes. (remm)
</fix>
+ <fix>
+ <bug>49991</bug>: Fix calling Request listeners when entering and exiting
+ the application scope in the main host valve, not simply just before
+ calling the filter chain. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
@@ -99,6 +85,9 @@
<fix>
<bug>50105</bug>: Use Enum.name() rather than Enum.toString() in composite expressions. (markt)
</fix>
+ <fix>
+ Close reader in JDT compiler. (markt)
+ </fix>
</changelog>
</subsection>
</section>
14 years
JBossWeb SVN: r1610 - branches.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-12-09 04:17:27 -0500 (Thu, 09 Dec 2010)
New Revision: 1610
Added:
branches/3.0.x/
Log:
- Branch 3.0 for AS 6.
Copied: branches/3.0.x (from rev 1609, tags/JBOSSWEB_3_0_0_BETA7)
14 years
JBossWeb SVN: r1609 - in trunk: java/org/apache/jasper/compiler and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-12-08 11:15:22 -0500 (Wed, 08 Dec 2010)
New Revision: 1609
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/jasper/compiler/JDTCompiler.java
trunk/webapps/docs/changelog.xml
Log:
- Port patch to close a reader in JDT, as well as an IS when using a JMX call.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2010-12-07 22:40:05 UTC (rev 1608)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2010-12-08 16:15:22 UTC (rev 1609)
@@ -4541,17 +4541,25 @@
if (stream == null) {
return "";
}
- BufferedReader br = new BufferedReader(
- new InputStreamReader(stream));
+ BufferedReader br = null;
StringBuilder sb = new StringBuilder();
- String strRead = "";
try {
+ br = new BufferedReader(new InputStreamReader(stream));
+ String strRead = "";
while (strRead != null) {
sb.append(strRead);
strRead = br.readLine();
}
} catch (IOException e) {
return "";
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
}
return sb.toString();
Modified: trunk/java/org/apache/jasper/compiler/JDTCompiler.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/JDTCompiler.java 2010-12-07 22:40:05 UTC (rev 1608)
+++ trunk/java/org/apache/jasper/compiler/JDTCompiler.java 2010-12-08 16:15:22 UTC (rev 1609)
@@ -100,10 +100,10 @@
public char[] getContents() {
char[] result = null;
FileInputStream is = null;
+ Reader reader = null;
try {
is = new FileInputStream(sourceFile);
- Reader reader =
- new BufferedReader(new InputStreamReader(is, ctxt.getOptions().getJavaEncoding()));
+ reader = new BufferedReader(new InputStreamReader(is, ctxt.getOptions().getJavaEncoding()));
if (reader != null) {
char[] chars = new char[8192];
StringBuilder buf = new StringBuilder();
@@ -118,6 +118,13 @@
} catch (IOException e) {
log.error("Compilation error", e);
} finally {
+ if (reader != null) {
+ try {
+ reader.close();
+ } catch (IOException exc) {
+ // Ignore
+ }
+ }
if (is != null) {
try {
is.close();
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-12-07 22:40:05 UTC (rev 1608)
+++ trunk/webapps/docs/changelog.xml 2010-12-08 16:15:22 UTC (rev 1609)
@@ -16,6 +16,25 @@
<body>
+<section name="JBoss Web 3.0.0.Beta9 (remm)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ <bug>49991</bug>: Fix calling Request listeners when entering and exiting
+ the application scope in the main host valve, not simply just before
+ calling the filter chain. (remm)
+ </fix>
+ </changelog>
+ </subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ Close reader in JDT compiler. (markt)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
+
<section name="JBoss Web 3.0.0.Beta8 (remm)">
<subsection name="Catalina">
<changelog>
@@ -32,10 +51,6 @@
<bug>49779</bug>: Interaction between continue and FORM. (markt)
</fix>
<fix>
- <bug>49991</bug>: Actually call Request listener when entering and exiting the application scope, not simply just before
- calling the filter chain. (remm)
- </fix>
- <fix>
Allow a landing page for FORM. (markt)
</fix>
<fix>
14 years
JBossWeb SVN: r1608 - trunk/java/org/apache/catalina/core.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-12-07 17:40:05 -0500 (Tue, 07 Dec 2010)
New Revision: 1608
Modified:
trunk/java/org/apache/catalina/core/StandardHostValve.java
Log:
- Fix bad cast created when copying the code from context to host valve.
Modified: trunk/java/org/apache/catalina/core/StandardHostValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardHostValve.java 2010-12-07 14:20:50 UTC (rev 1607)
+++ trunk/java/org/apache/catalina/core/StandardHostValve.java 2010-12-07 22:40:05 UTC (rev 1608)
@@ -119,11 +119,8 @@
}
// Bind the context CL to the current thread
- if( context.getLoader() != null ) {
- // Not started - it should check for availability first
- // This should eventually move to Engine, it's generic.
- Thread.currentThread().setContextClassLoader
- (context.getLoader().getClassLoader());
+ if (context.getLoader() != null) {
+ Thread.currentThread().setContextClassLoader(context.getLoader().getClassLoader());
}
// Enter application scope
@@ -133,17 +130,14 @@
if ((instances != null)
&& (instances.length > 0)) {
- event = new ServletRequestEvent
- (((StandardContext) container).getServletContext(),
- request.getRequest());
+ event = new ServletRequestEvent(context.getServletContext(), request.getRequest());
// create pre-service event
for (int i = 0; i < instances.length; i++) {
if (instances[i] == null)
continue;
if (!(instances[i] instanceof ServletRequestListener))
continue;
- ServletRequestListener listener =
- (ServletRequestListener) instances[i];
+ ServletRequestListener listener = (ServletRequestListener) instances[i];
try {
listener.requestInitialized(event);
} catch (Throwable t) {
@@ -185,8 +179,7 @@
continue;
if (!(instances[i] instanceof ServletRequestListener))
continue;
- ServletRequestListener listener =
- (ServletRequestListener) instances[i];
+ ServletRequestListener listener = (ServletRequestListener) instances[i];
try {
listener.requestDestroyed(event);
} catch (Throwable t2) {
@@ -197,10 +190,9 @@
}
}
}
-
+
// Restore the context classloader
- Thread.currentThread().setContextClassLoader
- (StandardHostValve.class.getClassLoader());
+ Thread.currentThread().setContextClassLoader(StandardHostValve.class.getClassLoader());
}
@@ -222,28 +214,22 @@
Context context = request.getContext();
// Bind the context CL to the current thread
- if( context.getLoader() != null ) {
- // Not started - it should check for availability first
- // This should eventually move to Engine, it's generic.
- Thread.currentThread().setContextClassLoader
- (context.getLoader().getClassLoader());
+ if (context.getLoader() != null) {
+ Thread.currentThread().setContextClassLoader(context.getLoader().getClassLoader());
}
// Enter application scope
Object instances[] = context.getApplicationEventListeners();
ServletRequestEvent event2 = null;
if (instances != null && (instances.length > 0)) {
- event2 = new ServletRequestEvent
- (((StandardContext) container).getServletContext(),
- request.getRequest());
+ event2 = new ServletRequestEvent(context.getServletContext(), request.getRequest());
// create pre-service event
for (int i = 0; i < instances.length; i++) {
if (instances[i] == null)
continue;
if (!(instances[i] instanceof ServletRequestListener))
continue;
- ServletRequestListener listener =
- (ServletRequestListener) instances[i];
+ ServletRequestListener listener = (ServletRequestListener) instances[i];
try {
listener.requestInitialized(event2);
} catch (Throwable t) {
@@ -299,8 +285,7 @@
continue;
if (!(instances[i] instanceof ServletRequestListener))
continue;
- ServletRequestListener listener =
- (ServletRequestListener) instances[i];
+ ServletRequestListener listener = (ServletRequestListener) instances[i];
try {
listener.requestDestroyed(event2);
} catch (Throwable t) {
@@ -311,10 +296,9 @@
}
}
}
-
+
// Restore the context classloader
- Thread.currentThread().setContextClassLoader
- (StandardHostValve.class.getClassLoader());
+ Thread.currentThread().setContextClassLoader(StandardHostValve.class.getClassLoader());
}
14 years