JBossWeb SVN: r818 - in trunk: java/org/apache/tomcat/util/net/res and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-10-27 12:54:26 -0400 (Mon, 27 Oct 2008)
New Revision: 818
Modified:
trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties
trunk/webapps/docs/changelog.xml
Log:
- Add info messages when maxThreads is reached.
Modified: trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-10-27 15:01:23 UTC (rev 817)
+++ trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-10-27 16:54:26 UTC (rev 818)
@@ -902,6 +902,11 @@
}
if ((maxThreads > 0) && (curThreads < maxThreads)) {
curThreadsBusy++;
+ if (curThreadsBusy == maxThreads) {
+ log.info(sm.getString("endpoint.info.maxThreads",
+ Integer.toString(maxThreads), address,
+ Integer.toString(port)));
+ }
return (newWorkerThread());
} else {
if (maxThreads < 0) {
Modified: trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2008-10-27 15:01:23 UTC (rev 817)
+++ trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2008-10-27 16:54:26 UTC (rev 818)
@@ -662,6 +662,11 @@
}
if ((maxThreads > 0) && (curThreads < maxThreads)) {
curThreadsBusy++;
+ if (curThreadsBusy == maxThreads) {
+ log.info(sm.getString("endpoint.info.maxThreads",
+ Integer.toString(maxThreads), address,
+ Integer.toString(port)));
+ }
return (newWorkerThread());
} else {
if (maxThreads < 0) {
Modified: trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties
===================================================================
--- trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties 2008-10-27 15:01:23 UTC (rev 817)
+++ trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties 2008-10-27 16:54:26 UTC (rev 818)
@@ -1,6 +1,7 @@
# net resources
endpoint.err.fatal=Endpoint {0} shutdown due to exception: {1}
endpoint.err.nonfatal=Endpoint {0} ignored exception: {1}
+endpoint.info.maxThreads=Maximum number of threads ({0}) created for connector with address {1} and port {2}
endpoint.warn.reinit=Reinitializing ServerSocket
endpoint.warn.restart=Restarting endpoint
endpoint.warn.security=Endpoint {0} security exception: {1}
@@ -22,5 +23,5 @@
endpoint.maintain.error=Error processing timeouts
endpoint.process.fail=Error allocating socket processor
endpoint.sendfile.error=Unexpected sendfile error
-endpoint.sendfile.addfail=Sednfile failure: [{0}] {1}
+endpoint.sendfile.addfail=Sendfile failure: [{0}] {1}
endpoint.sendfile.nosupport=Disabling sendfile, since either the APR version or the system doesn't support it
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-10-27 15:01:23 UTC (rev 817)
+++ trunk/webapps/docs/changelog.xml 2008-10-27 16:54:26 UTC (rev 818)
@@ -94,6 +94,9 @@
<fix>
<bug>46077</bug>: Add configuration for deferAccept flag. (remm)
</fix>
+ <fix>
+ Add maxThreads warning. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
16 years, 2 months
JBossWeb SVN: r817 - in trunk: java/org/apache/coyote/http11 and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-10-27 11:01:23 -0400 (Mon, 27 Oct 2008)
New Revision: 817
Modified:
trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
trunk/webapps/docs/apr.xml
trunk/webapps/docs/changelog.xml
Log:
- Add defer accept flag.
Modified: trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java 2008-10-23 15:17:08 UTC (rev 816)
+++ trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java 2008-10-27 15:01:23 UTC (rev 817)
@@ -293,6 +293,9 @@
public boolean getReverseConnection() { return endpoint.isReverseConnection(); }
public void setReverseConnection(boolean reverseConnection) { endpoint.setReverseConnection(reverseConnection); }
+ public boolean getDeferAccept() { return endpoint.getDeferAccept(); }
+ public void setDeferAccept(boolean deferAccept) { endpoint.setDeferAccept(deferAccept); }
+
/**
* Should authentication be done in the native webserver layer,
* or in the Servlet container ?
Modified: trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2008-10-23 15:17:08 UTC (rev 816)
+++ trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2008-10-27 15:01:23 UTC (rev 817)
@@ -247,6 +247,9 @@
public boolean getReverseConnection() { return endpoint.isReverseConnection(); }
public void setReverseConnection(boolean reverseConnection) { endpoint.setReverseConnection(reverseConnection); }
+ public boolean getDeferAccept() { return endpoint.getDeferAccept(); }
+ public void setDeferAccept(boolean deferAccept) { endpoint.setDeferAccept(deferAccept); }
+
/**
* The number of seconds Tomcat will wait for a subsequent request
* before closing the connection.
Modified: trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-10-23 15:17:08 UTC (rev 816)
+++ trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-10-27 15:01:23 UTC (rev 817)
@@ -155,12 +155,6 @@
protected long sslContext = 0;
- /**
- * Defer accept.
- */
- protected boolean deferAccept = true;
-
-
// ------------------------------------------------------------- Properties
@@ -263,6 +257,14 @@
/**
+ * Defer accept.
+ */
+ protected boolean deferAccept = true;
+ public void setDeferAccept(boolean deferAccept) { this.deferAccept = deferAccept; }
+ public boolean getDeferAccept() { return deferAccept; }
+
+
+ /**
* Keep-Alive timeout.
*/
protected int keepAliveTimeout = -1;
@@ -621,7 +623,7 @@
// Delay accepting of new connections until data is available
// Only Linux kernels 2.4 + have that implemented
// on other platforms this call is noop and will return APR_ENOTIMPL.
- if (Socket.optSet(serverSock, Socket.APR_TCP_DEFER_ACCEPT, 1) == Status.APR_ENOTIMPL) {
+ if (deferAccept && (Socket.optSet(serverSock, Socket.APR_TCP_DEFER_ACCEPT, 1) == Status.APR_ENOTIMPL)) {
deferAccept = false;
}
} else {
Modified: trunk/webapps/docs/apr.xml
===================================================================
--- trunk/webapps/docs/apr.xml 2008-10-23 15:17:08 UTC (rev 816)
+++ trunk/webapps/docs/apr.xml 2008-10-27 15:01:23 UTC (rev 817)
@@ -152,6 +152,10 @@
<attributes>
+ <attribute name="deferAccept" required="false">
+ <p>Use defer accept feature if available. The default value is true.</p>
+ </attribute>
+
<attribute name="keepAliveTimeout" required="false">
<p>The number of milliseconds this <strong>Connector</strong> will wait for
another HTTP request before closing the connection.
@@ -315,6 +319,10 @@
<attributes>
+ <attribute name="deferAccept" required="false">
+ <p>Use defer accept feature if available. The default value is true.</p>
+ </attribute>
+
<attribute name="pollTime" required="false">
<p>Duration of a poll call. Lowering this value will slightly decrease latency of connections
being kept alive in some cases, but will use more CPU as more poll calls are being made. The
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-10-23 15:17:08 UTC (rev 816)
+++ trunk/webapps/docs/changelog.xml 2008-10-27 15:01:23 UTC (rev 817)
@@ -91,6 +91,9 @@
<fix>
New maxThreads default to 200, up from 40. (remm)
</fix>
+ <fix>
+ <bug>46077</bug>: Add configuration for deferAccept flag. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
16 years, 2 months
JBossWeb SVN: r816 - trunk/java/org/apache/tomcat/bayeux.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-10-23 11:17:08 -0400 (Thu, 23 Oct 2008)
New Revision: 816
Modified:
trunk/java/org/apache/tomcat/bayeux/BayeuxServlet.java
trunk/java/org/apache/tomcat/bayeux/ClientImpl.java
trunk/java/org/apache/tomcat/bayeux/RequestBase.java
Log:
- Port tweaks.
Modified: trunk/java/org/apache/tomcat/bayeux/BayeuxServlet.java
===================================================================
--- trunk/java/org/apache/tomcat/bayeux/BayeuxServlet.java 2008-10-23 13:38:23 UTC (rev 815)
+++ trunk/java/org/apache/tomcat/bayeux/BayeuxServlet.java 2008-10-23 15:17:08 UTC (rev 816)
@@ -93,7 +93,7 @@
protected int getReconnectInterval() {
String rs = servletConfig.getInitParameter("reconnectInterval");
- int rct = 5000; //5 seconds
+ int rct = 1000; // 1 seconds
try {
rct = Integer.parseInt(rs);
}catch (NumberFormatException nfe) {
Modified: trunk/java/org/apache/tomcat/bayeux/ClientImpl.java
===================================================================
--- trunk/java/org/apache/tomcat/bayeux/ClientImpl.java 2008-10-23 13:38:23 UTC (rev 815)
+++ trunk/java/org/apache/tomcat/bayeux/ClientImpl.java 2008-10-23 15:17:08 UTC (rev 816)
@@ -111,9 +111,10 @@
//local clients must have a listener
ArrayList<Message> list = new ArrayList<Message>();
for (int i=0; msgs!=null && i<msgs.length; i++) {
+ //dont deliver to ourselves
if (this!=msgs[i].getClient()) list.add(msgs[i]);
}
- if (getListener() != null) {
+ if (getListener() != null && list.size()>0) {
getListener().deliver(list.toArray(new Message[0]));
}
} else {
Modified: trunk/java/org/apache/tomcat/bayeux/RequestBase.java
===================================================================
--- trunk/java/org/apache/tomcat/bayeux/RequestBase.java 2008-10-23 13:38:23 UTC (rev 815)
+++ trunk/java/org/apache/tomcat/bayeux/RequestBase.java 2008-10-23 15:17:08 UTC (rev 816)
@@ -71,7 +71,7 @@
protected HashMap<String, Object> response = null;
- protected int reconnectInterval;
+ protected int reconnectInterval = 1000;
protected RequestBase(TomcatBayeux tb, HttpEvent event, JSONObject jsReq) throws JSONException {
this.tomcatBayeux = tb;
16 years, 3 months
JBossWeb SVN: r815 - trunk/webapps/docs/config.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-10-23 09:38:23 -0400 (Thu, 23 Oct 2008)
New Revision: 815
Modified:
trunk/webapps/docs/config/ajp.xml
Log:
- maxThreads = 200 is the new default.
Modified: trunk/webapps/docs/config/ajp.xml
===================================================================
--- trunk/webapps/docs/config/ajp.xml 2008-10-23 11:04:06 UTC (rev 814)
+++ trunk/webapps/docs/config/ajp.xml 2008-10-23 13:38:23 UTC (rev 815)
@@ -231,7 +231,7 @@
<p>The maximum number of request processing threads to be created
by this <strong>Connector</strong>, which therefore determines the
maximum number of simultaneous requests that can be handled. If
- not specified, this attribute is set to 40. If an executor is associated
+ not specified, this attribute is set to 200. If an executor is associated
with this connector, this attribute is ignored as the connector will
execute tasks using the executor rather than an internal thread pool.</p>
</attribute>
16 years, 3 months
JBossWeb SVN: r814 - in trunk: webapps/docs and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-10-23 07:04:06 -0400 (Thu, 23 Oct 2008)
New Revision: 814
Modified:
trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
trunk/webapps/docs/changelog.xml
trunk/webapps/docs/config/http.xml
Log:
- maxThreads = 200 is the new default.
Modified: trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-10-21 14:25:54 UTC (rev 813)
+++ trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-10-23 11:04:06 UTC (rev 814)
@@ -175,7 +175,7 @@
/**
* Maximum amount of worker threads.
*/
- protected int maxThreads = 40;
+ protected int maxThreads = 200;
public void setMaxThreads(int maxThreads) { this.maxThreads = maxThreads; }
public int getMaxThreads() { return maxThreads; }
Modified: trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2008-10-21 14:25:54 UTC (rev 813)
+++ trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2008-10-23 11:04:06 UTC (rev 814)
@@ -151,7 +151,7 @@
/**
* Maximum amount of worker threads.
*/
- protected int maxThreads = 40;
+ protected int maxThreads = 200;
public void setMaxThreads(int maxThreads) { this.maxThreads = maxThreads; }
public int getMaxThreads() { return maxThreads; }
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-10-21 14:25:54 UTC (rev 813)
+++ trunk/webapps/docs/changelog.xml 2008-10-23 11:04:06 UTC (rev 814)
@@ -88,6 +88,9 @@
<fix>
Handling for invalid AJP messages. (remm)
</fix>
+ <fix>
+ New maxThreads default to 200, up from 40. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
Modified: trunk/webapps/docs/config/http.xml
===================================================================
--- trunk/webapps/docs/config/http.xml 2008-10-21 14:25:54 UTC (rev 813)
+++ trunk/webapps/docs/config/http.xml 2008-10-23 11:04:06 UTC (rev 814)
@@ -300,7 +300,7 @@
<p>The maximum number of request processing threads to be created
by this <strong>Connector</strong>, which therefore determines the
maximum number of simultaneous requests that can be handled. If
- not specified, this attribute is set to 40. If an executor is associated
+ not specified, this attribute is set to 200. If an executor is associated
with this connector, this attribute is ignored as the connector will
execute tasks using the executor rather than an internal thread pool.</p>
</attribute>
16 years, 3 months
JBossWeb SVN: r813 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-10-21 10:25:54 -0400 (Tue, 21 Oct 2008)
New Revision: 813
Modified:
trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
trunk/java/org/apache/coyote/ajp/AjpMessage.java
trunk/java/org/apache/coyote/ajp/AjpProcessor.java
trunk/java/org/apache/coyote/ajp/LocalStrings.properties
trunk/webapps/docs/changelog.xml
Log:
- Code to handle invalid AJP messages: set length to 0 and throw an IOE (in some cases it would have resulted in an EOF).
Modified: trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java 2008-10-20 10:42:51 UTC (rev 812)
+++ trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java 2008-10-21 14:25:54 UTC (rev 813)
@@ -1163,7 +1163,9 @@
read(headerLength);
}
inputBuffer.get(message.getBuffer(), 0, headerLength);
- message.processHeader();
+ if (message.processHeader() < 0) {
+ throw new IOException(sm.getString("ajpprotocol.badmessage"));
+ }
read(message.getLen());
inputBuffer.get(message.getBuffer(), headerLength, message.getLen());
Modified: trunk/java/org/apache/coyote/ajp/AjpMessage.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpMessage.java 2008-10-20 10:42:51 UTC (rev 812)
+++ trunk/java/org/apache/coyote/ajp/AjpMessage.java 2008-10-21 14:25:54 UTC (rev 813)
@@ -398,6 +398,7 @@
if (log.isDebugEnabled()) {
dump("In: ");
}
+ len = 0;
return -1;
}
if (log.isDebugEnabled()) {
Modified: trunk/java/org/apache/coyote/ajp/AjpProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpProcessor.java 2008-10-20 10:42:51 UTC (rev 812)
+++ trunk/java/org/apache/coyote/ajp/AjpProcessor.java 2008-10-21 14:25:54 UTC (rev 813)
@@ -1110,7 +1110,9 @@
read(buf, 0, message.getHeaderLength());
- message.processHeader();
+ if (message.processHeader() < 0) {
+ throw new IOException(sm.getString("ajpprotocol.badmessage"));
+ }
read(buf, message.getHeaderLength(), message.getLen());
return true;
Modified: trunk/java/org/apache/coyote/ajp/LocalStrings.properties
===================================================================
--- trunk/java/org/apache/coyote/ajp/LocalStrings.properties 2008-10-20 10:42:51 UTC (rev 812)
+++ trunk/java/org/apache/coyote/ajp/LocalStrings.properties 2008-10-21 14:25:54 UTC (rev 813)
@@ -23,15 +23,16 @@
ajpprotocol.failedread=Socket read failed
ajpprotocol.failedwrite=Socket write failed
ajpprotocol.request.register=Error registering request processor in JMX
+ajpprotocol.badmessage=Invalid message received
ajpprocessor.header.error=Header message parsing failed
ajpprocessor.request.prepare=Error preparing request
ajpprocessor.request.process=Error processing request
-ajpprocessor.certs.fail=Certificate convertion failed
+ajpprocessor.certs.fail=Certificate conversion failed
ajpprocessor.socket.info=Exception getting socket information
ajpmessage.null=Cannot append null value
ajpmessage.overflow=Overflow error for buffer adding {0} bytes at position {1}
ajpmessage.read=Requested {0} bytes exceeds message available data
-ajpmessage.invalid=Invalid message recieved with signature {0}
+ajpmessage.invalid=Invalid message received with signature {0}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-10-20 10:42:51 UTC (rev 812)
+++ trunk/webapps/docs/changelog.xml 2008-10-21 14:25:54 UTC (rev 813)
@@ -85,6 +85,9 @@
<fix>
Null out socket in java.io HTTP connector. (fhanik)
</fix>
+ <fix>
+ Handling for invalid AJP messages. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
16 years, 3 months
JBossWeb SVN: r812 - in trunk: java/org/apache/catalina/core and 3 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-10-20 06:42:51 -0400 (Mon, 20 Oct 2008)
New Revision: 812
Modified:
trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
trunk/java/org/apache/jasper/compiler/Generator.java
trunk/webapps/docs/changelog.xml
trunk/webapps/docs/config/context.xml
trunk/webapps/docs/config/host.xml
Log:
- More EL fixes (joy) :)
- Fix default names for annotations lookups when a superclass has the annotation.
Modified: trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2008-10-17 14:03:57 UTC (rev 811)
+++ trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2008-10-20 10:42:51 UTC (rev 812)
@@ -382,16 +382,14 @@
Response response)
throws Exception {
- // XXX the processor needs to set a correct scheme and port prior to this point,
- // in ajp13 protocols dont make sense to get the port from the connector..
- // XXX the processor may have set a correct scheme and port prior to this point,
- // in ajp13 protocols dont make sense to get the port from the connector...
+ // FIXME: The processor needs to set a correct scheme and port prior to this point,
+ // in ajp13 protocol does not make sense to get the port from the connector..
// otherwise, use connector configuration
if (! req.scheme().isNull()) {
// use processor specified scheme to determine secure state
request.setSecure(req.scheme().equals("https"));
} else {
- // use connector scheme and secure configuration, (defaults to
+ // Use connector scheme and secure configuration, (defaults to
// "http" and false respectively)
req.scheme().setString(connector.getScheme());
request.setSecure(connector.getSecure());
Modified: trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
===================================================================
--- trunk/java/org/apache/catalina/core/DefaultInstanceManager.java 2008-10-17 14:03:57 UTC (rev 811)
+++ trunk/java/org/apache/catalina/core/DefaultInstanceManager.java 2008-10-20 10:42:51 UTC (rev 812)
@@ -50,7 +50,7 @@
import org.apache.catalina.util.StringManager;
/**
- * @version $Rev$ $Date$
+ * @version $Rev:$ $Date:$
*/
public class DefaultInstanceManager implements InstanceManager {
@@ -112,12 +112,12 @@
}
public Object newInstance(String className) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException {
- Class clazz = loadClassMaybePrivileged(className, classLoader);
+ Class<?> clazz = loadClassMaybePrivileged(className, classLoader);
return newInstance(clazz.newInstance(), clazz);
}
public Object newInstance(final String className, final ClassLoader classLoader) throws IllegalAccessException, NamingException, InvocationTargetException, InstantiationException, ClassNotFoundException {
- Class clazz = classLoader.loadClass(className);
+ Class<?> clazz = classLoader.loadClass(className);
return newInstance(clazz.newInstance(), clazz);
}
@@ -126,7 +126,7 @@
newInstance(o, o.getClass());
}
- private Object newInstance(Object instance, Class clazz) throws IllegalAccessException, InvocationTargetException, NamingException {
+ private Object newInstance(Object instance, Class<?> clazz) throws IllegalAccessException, InvocationTargetException, NamingException {
if (!ignoreAnnotations) {
Map<String, String> injections = injectionMap.get(clazz.getName());
processAnnotations(instance, injections);
@@ -150,9 +150,9 @@
* @throws java.lang.reflect.InvocationTargetException
* if call fails
*/
- protected void postConstruct(Object instance, Class clazz)
+ protected void postConstruct(Object instance, Class<?> clazz)
throws IllegalAccessException, InvocationTargetException {
- Class superClass = clazz.getSuperclass();
+ Class<?> superClass = clazz.getSuperclass();
if (superClass != Object.class) {
postConstruct(instance, superClass);
}
@@ -193,9 +193,9 @@
* @throws java.lang.reflect.InvocationTargetException
* if call fails
*/
- protected void preDestroy(Object instance, Class clazz)
+ protected void preDestroy(Object instance, Class<?> clazz)
throws IllegalAccessException, InvocationTargetException {
- Class superClass = clazz.getSuperclass();
+ Class<?> superClass = clazz.getSuperclass();
if (superClass != Object.class) {
preDestroy(instance, superClass);
}
@@ -252,25 +252,31 @@
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
if (injections != null && injections.containsKey(field.getName())) {
- lookupFieldResource(context, instance, field, injections.get(field.getName()));
+ lookupFieldResource(context, instance, field,
+ injections.get(field.getName()), clazz);
} else if (field.isAnnotationPresent(Resource.class)) {
Resource annotation = field.getAnnotation(Resource.class);
- lookupFieldResource(context, instance, field, annotation.name());
+ lookupFieldResource(context, instance, field,
+ annotation.name(), clazz);
} else if (field.isAnnotationPresent(EJB.class)) {
EJB annotation = field.getAnnotation(EJB.class);
- lookupFieldResource(context, instance, field, annotation.name());
+ lookupFieldResource(context, instance, field,
+ annotation.name(), clazz);
} else if (field.isAnnotationPresent(WebServiceRef.class)) {
WebServiceRef annotation =
field.getAnnotation(WebServiceRef.class);
- lookupFieldResource(context, instance, field, annotation.name());
+ lookupFieldResource(context, instance, field,
+ annotation.name(), clazz);
} else if (field.isAnnotationPresent(PersistenceContext.class)) {
PersistenceContext annotation =
field.getAnnotation(PersistenceContext.class);
- lookupFieldResource(context, instance, field, annotation.name());
+ lookupFieldResource(context, instance, field,
+ annotation.name(), clazz);
} else if (field.isAnnotationPresent(PersistenceUnit.class)) {
PersistenceUnit annotation =
field.getAnnotation(PersistenceUnit.class);
- lookupFieldResource(context, instance, field, annotation.name());
+ lookupFieldResource(context, instance, field,
+ annotation.name(), clazz);
}
}
@@ -281,28 +287,34 @@
if (injections != null && methodName.startsWith("set") && methodName.length() > 3) {
String fieldName = Character.toLowerCase(methodName.charAt(3)) + methodName.substring(4);
if (injections.containsKey(fieldName)) {
- lookupMethodResource(context, instance, method, injections.get(fieldName));
+ lookupMethodResource(context, instance, method,
+ injections.get(fieldName), clazz);
break;
}
}
if (method.isAnnotationPresent(Resource.class)) {
Resource annotation = method.getAnnotation(Resource.class);
- lookupMethodResource(context, instance, method, annotation.name());
+ lookupMethodResource(context, instance, method,
+ annotation.name(), clazz);
} else if (method.isAnnotationPresent(EJB.class)) {
EJB annotation = method.getAnnotation(EJB.class);
- lookupMethodResource(context, instance, method, annotation.name());
+ lookupMethodResource(context, instance, method,
+ annotation.name(), clazz);
} else if (method.isAnnotationPresent(WebServiceRef.class)) {
WebServiceRef annotation =
method.getAnnotation(WebServiceRef.class);
- lookupMethodResource(context, instance, method, annotation.name());
+ lookupMethodResource(context, instance, method,
+ annotation.name(), clazz);
} else if (method.isAnnotationPresent(PersistenceContext.class)) {
PersistenceContext annotation =
method.getAnnotation(PersistenceContext.class);
- lookupMethodResource(context, instance, method, annotation.name());
+ lookupMethodResource(context, instance, method,
+ annotation.name(), clazz);
} else if (method.isAnnotationPresent(PersistenceUnit.class)) {
PersistenceUnit annotation =
method.getAnnotation(PersistenceUnit.class);
- lookupMethodResource(context, instance, method, annotation.name());
+ lookupMethodResource(context, instance, method,
+ annotation.name(), clazz);
}
}
clazz = clazz.getSuperclass();
@@ -311,13 +323,13 @@
}
- protected Class loadClassMaybePrivileged(final String className, final ClassLoader classLoader) throws ClassNotFoundException {
- Class clazz;
+ protected Class<?> loadClassMaybePrivileged(final String className, final ClassLoader classLoader) throws ClassNotFoundException {
+ Class<?> clazz;
if (SecurityUtil.isPackageProtectionEnabled()) {
try {
- clazz = AccessController.doPrivileged(new PrivilegedExceptionAction<Class>() {
+ clazz = AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
- public Class run() throws Exception {
+ public Class<?> run() throws Exception {
return loadClass(className, classLoader);
}
});
@@ -335,12 +347,12 @@
return clazz;
}
- protected Class loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
- if (className.startsWith("org.apache.catalina") || className.startsWith("org.jboss.web")) {
+ protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
+ if (className.startsWith("org.apache.catalina")) {
return containerClassLoader.loadClass(className);
}
try {
- Class clazz = containerClassLoader.loadClass(className);
+ Class<?> clazz = containerClassLoader.loadClass(className);
if (ContainerServlet.class.isAssignableFrom(clazz)) {
return clazz;
}
@@ -350,7 +362,7 @@
return classLoader.loadClass(className);
}
- private void checkAccess(Class clazz) {
+ private void checkAccess(Class<?> clazz) {
if (privileged) return;
if (Filter.class.isAssignableFrom(clazz)) {
checkAccess(clazz, restrictedFilters);
@@ -361,10 +373,10 @@
}
}
- private void checkAccess(Class clazz, Properties restricted) {
+ private void checkAccess(Class<?> clazz, Properties restricted) {
while (clazz != null) {
if ("restricted".equals(restricted.getProperty(clazz.getName()))) {
- throw new SecurityException("Restricted class: " + clazz.getName());
+ throw new SecurityException("Restricted class" + clazz);
}
clazz = clazz.getSuperclass();
}
@@ -378,11 +390,12 @@
* @param instance object to inject into
* @param field field target for injection
* @param name jndi name value is bound under
+ * @param clazz class annotation is defined in
* @throws IllegalAccessException if field is inaccessible
* @throws javax.naming.NamingException if value is not accessible in naming context
*/
protected static void lookupFieldResource(Context context,
- Object instance, Field field, String name)
+ Object instance, Field field, String name, Class<?> clazz)
throws NamingException, IllegalAccessException {
Object lookedupResource;
@@ -392,7 +405,8 @@
(name.length() > 0)) {
lookedupResource = context.lookup(name);
} else {
- lookedupResource = context.lookup(instance.getClass().getName() + "/" + field.getName());
+ lookedupResource =
+ context.lookup(clazz.getName() + "/" + field.getName());
}
accessibility = field.isAccessible();
@@ -408,13 +422,14 @@
* @param instance object to inject into
* @param method field target for injection
* @param name jndi name value is bound under
+ * @param clazz class annotation is defined in
* @throws IllegalAccessException if method is inaccessible
* @throws javax.naming.NamingException if value is not accessible in naming context
* @throws java.lang.reflect.InvocationTargetException
* if setter call fails
*/
protected static void lookupMethodResource(Context context,
- Object instance, Method method, String name)
+ Object instance, Method method, String name, Class<?> clazz)
throws NamingException, IllegalAccessException, InvocationTargetException {
if (!method.getName().startsWith("set")
@@ -430,8 +445,8 @@
(name.length() > 0)) {
lookedupResource = context.lookup(name);
} else {
- lookedupResource =
- context.lookup(instance.getClass().getName() + "/" + method.getName().substring(3));
+ lookedupResource = context.lookup(
+ clazz.getName() + "/" + method.getName().substring(3));
}
accessibility = method.isAccessible();
Modified: trunk/java/org/apache/jasper/compiler/Generator.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Generator.java 2008-10-17 14:03:57 UTC (rev 811)
+++ trunk/java/org/apache/jasper/compiler/Generator.java 2008-10-20 10:42:51 UTC (rev 812)
@@ -48,20 +48,20 @@
/**
* Generate Java source from Nodes
- *
+ *
* @author Anil K. Vijendran
* @author Danno Ferrin
* @author Mandar Raje
* @author Rajiv Mordani
* @author Pierre Delisle
- *
+ *
* Tomcat 4.1.x and Tomcat 5:
* @author Kin-man Chung
* @author Jan Luehe
* @author Shawn Bayern
* @author Mark Roth
* @author Denis Benoit
- *
+ *
* Tomcat 6.x
* @author Jacob Hookom
* @author Remy Maucherat
@@ -71,7 +71,7 @@
private static final Class[] OBJECT_CLASS = { Object.class };
- private static final String VAR_EXPRESSIONFACTORY =
+ private static final String VAR_EXPRESSIONFACTORY =
System.getProperty("org.apache.jasper.compiler.Generator.VAR_EXPRESSIONFACTORY", "_el_expressionfactory");
private static final String VAR_INSTANCEMANAGER =
System.getProperty("org.apache.jasper.compiler.Generator.VAR_INSTANCEMANAGER", "_jsp_instancemanager");
@@ -186,7 +186,7 @@
/*
* Generates getServletInfo() method that returns the value of the
* page directive's 'info' attribute, if present.
- *
+ *
* The Validator has already ensured that if the translation unit
* contains more than one page directive with an 'info' attribute,
* their values match.
@@ -251,7 +251,7 @@
/*
* Constructor
- *
+ *
* @param v Vector of tag handler pool names to populate
*/
TagHandlerPoolVisitor(Vector v) {
@@ -280,7 +280,7 @@
/*
* Creates the name of the tag handler pool whose tag handlers may
* be (re)used to service this action.
- *
+ *
* @return The name of the tag handler pool
*/
private String createTagHandlerPoolName(String prefix,
@@ -379,7 +379,7 @@
* Generates the _jspInit() method for instantiating the tag handler pools.
* For tag file, _jspInit has to be invoked manually, and the ServletConfig
* object explicitly passed.
- *
+ *
* In JSP 2.1, we also instantiate an ExpressionFactory
*/
private void generateInit() {
@@ -403,7 +403,7 @@
out.println(");");
}
}
-
+
out.printin(VAR_EXPRESSIONFACTORY);
out.print(" = _jspxFactory.getJspApplicationContext(");
if (ctxt.isTagFile()) {
@@ -435,14 +435,14 @@
out.printil("public void _jspDestroy() {");
out.pushIndent();
-
+
if (isPoolingEnabled) {
for (int i = 0; i < tagHandlerPoolNames.size(); i++) {
out.printin((String) tagHandlerPoolNames.elementAt(i));
out.println(".release();");
}
}
-
+
out.popIndent();
out.printil("}");
out.println();
@@ -509,7 +509,7 @@
* Declare tag handler pools (tags of the same type and with the same
* attribute set share the same tag handler pool) (shared by servlet and tag
* handler preamble generation)
- *
+ *
* In JSP 2.1, we also scope an instance of ExpressionFactory
*/
private void genPreambleClassVariableDeclarations(String className)
@@ -542,7 +542,7 @@
out.popIndent();
out.printil("}");
out.println();
-
+
generateInit();
generateDestroy();
}
@@ -784,7 +784,7 @@
* interpreter. If the result is a Named Attribute we insert the
* generated variable name. Otherwise the result is a string literal,
* quoted and escaped.
- *
+ *
* @param attr
* An JspAttribute object
* @param encode
@@ -806,8 +806,8 @@
}
return v;
} else if (attr.isELInterpreterInput()) {
- v = JspUtil.interpreterCall(this.isTagFile, v, expectedType,
- attr.getEL().getMapName(), false);
+ v = attributeValueWithEL(this.isTagFile, v, expectedType,
+ attr.getEL().getMapName());
if (encode) {
return "org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("
+ v + ", request.getCharacterEncoding())";
@@ -824,10 +824,72 @@
}
}
+
+ /*
+ * When interpreting the EL attribute value, literals outside the EL
+ * must not be unescaped but the EL processor will unescape them.
+ * Therefore, make sure only the EL expressions are processed by the EL
+ * processor.
+ */
+ private String attributeValueWithEL(boolean isTag, String tx,
+ Class<?> expectedType, String mapName) {
+ if (tx==null) return null;
+ int size = tx.length();
+ StringBuffer output = new StringBuffer(size);
+ boolean el = false;
+ int i = 0;
+ int mark = 0;
+ char ch;
+
+ while(i < size){
+ ch = tx.charAt(i);
+
+ // Start of an EL expression
+ if (!el && i+1 < size && ch == '$' && tx.charAt(i+1)=='{') {
+ if (mark < i) {
+ if (output.length() > 0) {
+ output.append(" + ");
+ }
+ output.append(quote(tx.substring(mark, i)));
+ }
+ mark = i;
+ el = true;
+ i += 2;
+ } else if (ch=='\\' && i+1 < size &&
+ (tx.charAt(i+1)=='$' || tx.charAt(i+1)=='}')) {
+ // Skip an escaped $ or }
+ i += 2;
+ } else if (el && ch=='}') {
+ // End of an EL expression
+ if (output.length() > 0) {
+ output.append(" + ");
+ }
+ output.append(
+ JspUtil.interpreterCall(isTag,
+ tx.substring(mark, i+1), expectedType,
+ mapName, false));
+ mark = i + 1;
+ el = false;
+ ++i;
+ } else {
+ // Nothing to see here - move to next character
+ ++i;
+ }
+ }
+ if (!el && mark < i) {
+ if (output.length() > 0) {
+ output.append(" + ");
+ }
+ output.append(quote(tx.substring(mark, i)));
+ }
+ return output.toString();
+ }
+
+
/**
* Prints the attribute value specified in the param action, in the form
* of name=value string.
- *
+ *
* @param n
* the parent node for the param action nodes.
*/
@@ -2228,43 +2290,43 @@
}
private void writeNewInstance(String tagHandlerVar, String tagHandlerClassName) {
- if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
- out.printin(tagHandlerClassName);
- out.print(" ");
- out.print(tagHandlerVar);
- out.print(" = (");
- out.print(tagHandlerClassName);
- out.print(")");
- out.print(VAR_INSTANCEMANAGER);
- out.print(".newInstance(\"");
- out.print(tagHandlerClassName);
- out.println("\", this.getClass().getClassLoader());");
- } else {
- out.printin(tagHandlerClassName);
- out.print(" ");
- out.print(tagHandlerVar);
- out.print(" = (");
- out.print("new ");
- out.print(tagHandlerClassName);
- out.println("());");
+ if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
+ out.printin(tagHandlerClassName);
+ out.print(" ");
+ out.print(tagHandlerVar);
+ out.print(" = (");
+ out.print(tagHandlerClassName);
+ out.print(")");
+ out.print(VAR_INSTANCEMANAGER);
+ out.print(".newInstance(\"");
+ out.print(tagHandlerClassName);
+ out.println("\", this.getClass().getClassLoader());");
+ } else {
+ out.printin(tagHandlerClassName);
+ out.print(" ");
+ out.print(tagHandlerVar);
+ out.print(" = (");
+ out.print("new ");
+ out.print(tagHandlerClassName);
+ out.println("());");
if (Constants.INJECT_TAGS) {
- out.printin(VAR_INSTANCEMANAGER);
- out.print(".newInstance(");
- out.print(tagHandlerVar);
- out.println(");");
- }
- }
- }
-
- private void writeDestroyInstance(String tagHandlerVar) {
- if (Constants.INJECT_TAGS) {
out.printin(VAR_INSTANCEMANAGER);
- out.print(".destroyInstance(");
+ out.print(".newInstance(");
out.print(tagHandlerVar);
out.println(");");
}
}
+ }
+ private void writeDestroyInstance(String tagHandlerVar) {
+ if (Constants.INJECT_TAGS) {
+ out.printin(VAR_INSTANCEMANAGER);
+ out.print(".destroyInstance(");
+ out.print(tagHandlerVar);
+ out.println(");");
+ }
+ }
+
private void generateCustomEnd(Node.CustomTag n, String tagHandlerVar,
String tagEvalVar, String tagPushBodyCountVar) {
@@ -2497,7 +2559,7 @@
/*
* This method is called as part of the custom tag's start element.
- *
+ *
* If the given custom tag has a custom nesting level greater than 0,
* save the current values of its scripting variables to temporary
* variables, so those values may be restored in the tag's end element.
@@ -2559,7 +2621,7 @@
/*
* This method is called as part of the custom tag's end element.
- *
+ *
* If the given custom tag has a custom nesting level greater than 0,
* restore its scripting variables to their original values that were
* saved in the tag's start element.
@@ -2764,14 +2826,14 @@
// reset buffer
sb.setLength(0);
-
+
// create our mark
sb.append(n.getStart().toString());
sb.append(" '");
sb.append(attrValue);
- sb.append('\'');
+ sb.append('\'');
String mark = sb.toString();
-
+
// reset buffer
sb.setLength(0);
@@ -2840,8 +2902,8 @@
// run attrValue through the expression interpreter
String mapName = (attr.getEL() != null) ? attr.getEL()
.getMapName() : null;
- attrValue = JspUtil.interpreterCall(this.isTagFile,
- attrValue, c[0], mapName, false);
+ attrValue = attributeValueWithEL(this.isTagFile,
+ attrValue, c[0], mapName);
}
} else {
attrValue = convertString(c[0], attrValue, localName,
@@ -2852,7 +2914,7 @@
/**
* Generate code to create a map for the alias variables
- *
+ *
* @return the name of the map
*/
private String generateAliasMap(Node.CustomTag n, String tagHandlerVar)
@@ -2951,7 +3013,7 @@
for (int i = 0; attrs != null && i < attrs.length; i++) {
String attrValue = evaluateAttribute(handlerInfo, attrs[i], n,
tagHandlerVar);
-
+
Mark m = n.getStart();
out.printil("// "+m.getFile()+"("+m.getLineNumber()+","+m.getColumnNumber()+") "+ attrs[i].getTagAttributeInfo());
if (attrs[i].isDynamic()) {
@@ -3116,7 +3178,7 @@
/**
* Generate the code required to obtain the runtime value of the given
* named attribute.
- *
+ *
* @return The name of the temporary variable the result is stored in.
*/
public String generateNamedAttributeValue(Node.NamedAttribute n)
@@ -3167,7 +3229,7 @@
/**
* Similar to generateNamedAttributeValue, but create a JspFragment
* instead.
- *
+ *
* @param n
* The parent node of the named attribute
* @param tagHandlerVar
@@ -3322,7 +3384,7 @@
/**
* The main entry for Generator.
- *
+ *
* @param out
* The servlet output writer
* @param compiler
@@ -3439,7 +3501,7 @@
* share the code generator with JSPs.
*/
out.printil("PageContext _jspx_page_context = (PageContext)jspContext;");
-
+
// Declare implicit objects.
out.printil("HttpServletRequest request = "
+ "(HttpServletRequest) _jspx_page_context.getRequest();");
@@ -3450,10 +3512,10 @@
out.printil("ServletConfig config = _jspx_page_context.getServletConfig();");
out.printil("JspWriter out = jspContext.getOut();");
out.printil("_jspInit(config);");
-
+
// set current JspContext on ELContext
out.printil("jspContext.getELContext().putContext(JspContext.class,jspContext);");
-
+
generatePageScopedVariables(tagInfo);
declareTemporaryScriptingVars(tag);
@@ -3482,7 +3544,7 @@
out.popIndent();
out.printil("} finally {");
out.pushIndent();
-
+
// handle restoring VariableMapper
TagAttributeInfo[] attrInfos = tagInfo.getAttributes();
for (int i = 0; i < attrInfos.length; i++) {
@@ -3494,10 +3556,10 @@
out.println(");");
}
}
-
+
// restore nested JspContext on ELContext
out.printil("jspContext.getELContext().putContext(JspContext.class,super.getJspContext());");
-
+
out.printil("((org.apache.jasper.runtime.JspContextWrapper) jspContext).syncEndTagFile();");
if (isPoolingEnabled && !tagHandlerPoolNames.isEmpty()) {
out.printil("_jspDestroy();");
@@ -3712,17 +3774,17 @@
boolean variableMapperVar = false;
for (int i = 0; i < attrInfos.length; i++) {
String attrName = attrInfos[i].getName();
-
+
// handle assigning deferred vars to VariableMapper, storing
// previous values under '_el_ve[i]' for later re-assignment
if (attrInfos[i].isDeferredValue() || attrInfos[i].isDeferredMethod()) {
-
+
// we need to scope the modified VariableMapper for consistency and performance
if (!variableMapperVar) {
out.printil("javax.el.VariableMapper _el_variablemapper = jspContext.getELContext().getVariableMapper();");
variableMapperVar = true;
}
-
+
out.printin("javax.el.ValueExpression _el_ve");
out.print(i);
out.print(" = _el_variablemapper.setVariable(");
@@ -3788,7 +3850,7 @@
/**
* Constructor.
- *
+ *
* @param n
* The custom tag whose tag handler class is to be
* introspected
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-10-17 14:03:57 UTC (rev 811)
+++ trunk/webapps/docs/changelog.xml 2008-10-20 10:42:51 UTC (rev 812)
@@ -55,6 +55,9 @@
<fix>
Better nested context handling. (markt)
</fix>
+ <fix>
+ The default annotation name should be based on the class in which the annotation was found. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
Modified: trunk/webapps/docs/config/context.xml
===================================================================
--- trunk/webapps/docs/config/context.xml 2008-10-17 14:03:57 UTC (rev 811)
+++ trunk/webapps/docs/config/context.xml 2008-10-20 10:42:51 UTC (rev 812)
@@ -51,22 +51,30 @@
<p><strong>Context</strong> elements may be explicitly defined:
<ul>
- <li>in the <code>$CATALINA_HOME/conf/context.xml</code> file:
- the Context element information will be loaded by all webapps</li>
- <li>in the
- <code>$CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default</code>
+ <li>In the <code>$CATALINA_BASE/conf/context.xml</code> file:
+ the Context element information will be loaded by all webapps.</li>
+ <li>In the
+ <code>$CATALINA_BASE/conf/[enginename]/[hostname]/context.xml.default</code>
file: the Context element information will be loaded by all webapps of that
- host</li>
- <li>in individual files (with a ".xml" extension) in the
- <code>$CATALINA_HOME/conf/[enginename]/[hostname]/</code> directory.
- The name of the file (less the .xml) extension will be used as the
+ host.</li>
+ <li>In individual files (with a ".xml" extension) in the
+ <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code> directory.
+ The name of the file (less the .xml extension) will be used as the
context path. Multi-level context paths may be defined using #, e.g.
- <code>context#path.xml</code>. The default web application may be defined
- by using a file called <code>ROOT.xml</code>.</li>
- <li>if the previous file was not found for this application, in an individual
- file at <code>/META-INF/context.xml</code> inside the application files</li>
- <li>inside a <a href="host.html">Host</a> element in the main
- <code>conf/server.xml</code></li>
+ <code>foo#bar.xml</code> for a context path of <code>/foo/bar</code>. The
+ default web application may be defined by using a file called
+ <code>ROOT.xml</code>.</li>
+ <li>Only if a context file does not exist for the application in the
+ <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code>, in an individual
+ file at <code>/META-INF/context.xml</code> inside the application files. If
+ the web application is packaged as a WAR then
+ <code>/META-INF/context.xml</code> will be copied to
+ <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code> and renamed to
+ match the application's context path. Once this file exists, it will not be
+ replaced if a new WAR with a newer <code>/META-INF/context.xml</code> is
+ placed in the host's appBase.</li>
+ <li>Inside a <a href="host.html">Host</a> element in the main
+ <code>conf/server.xml</code>.</li>
</ul>
</p>
Modified: trunk/webapps/docs/config/host.xml
===================================================================
--- trunk/webapps/docs/config/host.xml 2008-10-17 14:03:57 UTC (rev 811)
+++ trunk/webapps/docs/config/host.xml 2008-10-20 10:42:51 UTC (rev 812)
@@ -265,7 +265,7 @@
<code>true</code> (which is the default value):</p>
<ul>
<li>Any XML file in the
- <code>$CATALINA_HOME/conf/[engine_name]/[host_name]</code> directory is
+ <code>$CATALINA_BASE/conf/[engine_name]/[host_name]</code> directory is
assumed to contain a
<a href="context.html">Context</a> element (and its associated
subelements) for a single web application. The <code>docBase</code>
@@ -279,20 +279,21 @@
directory of the same name (without the ".war" extension) will be
automatically expanded, unless the <code>unpackWARs</code> property
is set to <code>false</code>. If you redeploy an updated WAR file,
- be sure to delete the expanded directory when restarting JBoss Web, so
+ be sure to delete the expanded directory when restarting Tomcat, so
that the updated WAR file will be re-expanded (note that the auto
deployer, if enabled, will automatically expand the updated WAR file
- once the previously expanded directory is removed).</li>
+ once the previously expanded directory is removed). Multi-level contexts
+ may be defined by using #, eg use a WAR named <code>foo#bar.war</code>
+ for a context path of <code>/foo/bar</code>.</li>
<li>Any subdirectory within the <em>application base directory</em>
will receive an automatically generated <a href="context.html">
Context</a> element, even if this directory is not mentioned in the
- <code>conf/server.xml</code> file.
- This generated Context entry will be configured according to the
- properties set in any <a href="defaultcontext.html">DefaultContext</a>
- element nested in this Host element. The context path for this
+ <code>conf/server.xml</code> file. The context path for this
deployed Context will be a slash character ("/") followed by the
directory name, unless the directory name is ROOT, in which case
- the context path will be an empty string ("").</li>
+ the context path will be an empty string (""). Multi-level contexts
+ may be defined by using #, eg use a directory named <code>foo#bar</code>
+ for a context path of <code>/foo/bar</code>.</li>
</ul>
<p>In addition to the automatic deployment that occurs at startup time,
16 years, 3 months
JBossWeb SVN: r811 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/jboss/web/rewrite.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-10-17 10:03:57 -0400 (Fri, 17 Oct 2008)
New Revision: 811
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/jboss/web/rewrite/Substitution.java
Log:
Fix for JBWEB-122.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/jboss/web/rewrite/Substitution.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/jboss/web/rewrite/Substitution.java 2008-10-13 15:13:16 UTC (rev 810)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/jboss/web/rewrite/Substitution.java 2008-10-17 14:03:57 UTC (rev 811)
@@ -202,10 +202,10 @@
((ServerVariableEnvElement) newElement).key = sub.substring(colon + 1, close);
} else if (type.equals("SSL")) {
newElement = new ServerVariableSslElement();
- ((ServerVariableEnvElement) newElement).key = sub.substring(colon + 1, close);
+ ((ServerVariableSslElement) newElement).key = sub.substring(colon + 1, close);
} else if (type.equals("HTTP")) {
newElement = new ServerVariableHttpElement();
- ((ServerVariableEnvElement) newElement).key = sub.substring(colon + 1, close);
+ ((ServerVariableHttpElement) newElement).key = sub.substring(colon + 1, close);
} else {
throw new IllegalArgumentException(sub + ": Bad type: " + type);
}
16 years, 3 months
JBossWeb SVN: r810 - trunk/res/jboss/org/apache/catalina/startup.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-10-13 11:13:16 -0400 (Mon, 13 Oct 2008)
New Revision: 810
Modified:
trunk/res/jboss/org/apache/catalina/startup/catalina.properties
Log:
- Unless I missed something obvious, the classname is wrong.
Modified: trunk/res/jboss/org/apache/catalina/startup/catalina.properties
===================================================================
--- trunk/res/jboss/org/apache/catalina/startup/catalina.properties 2008-10-10 16:08:30 UTC (rev 809)
+++ trunk/res/jboss/org/apache/catalina/startup/catalina.properties 2008-10-13 15:13:16 UTC (rev 810)
@@ -4,7 +4,7 @@
org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
org.apache.catalina.connector.Request.SESSION_ID_CHECK=true
org.apache.catalina.core.StandardHost.autoDeploy=false
-org.apache.catalina.core.StandardHost.configClass=org.jboss.web.tomcat.security.config.JBossContextConfig
+org.apache.catalina.core.StandardHost.configClass=org.jboss.web.tomcat.service.deployers.JBossContextConfig
org.apache.catalina.core.StandardHost.deployOnStartup=false
org.apache.catalina.core.StandardHost.deployXML=false
org.apache.catalina.core.StandardHost.startChildren=false
16 years, 3 months
JBossWeb SVN: r809 - branches/JBOSSWEB_2_0_0_GA_CP05_JBPAPP-869/src/share/classes/org/apache/catalina/loader.
by jbossweb-commits@lists.jboss.org
Author: jhowell(a)redhat.com
Date: 2008-10-10 12:08:30 -0400 (Fri, 10 Oct 2008)
New Revision: 809
Modified:
branches/JBOSSWEB_2_0_0_GA_CP05_JBPAPP-869/src/share/classes/org/apache/catalina/loader/WebappClassLoader.java
Log:
[JBPAPP-951] - One-off patch for JBPAPP-869 - JBossWeb container uses JBoss xml parser rather than war deployment included parser
Modified: branches/JBOSSWEB_2_0_0_GA_CP05_JBPAPP-869/src/share/classes/org/apache/catalina/loader/WebappClassLoader.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP05_JBPAPP-869/src/share/classes/org/apache/catalina/loader/WebappClassLoader.java 2008-10-10 15:00:13 UTC (rev 808)
+++ branches/JBOSSWEB_2_0_0_GA_CP05_JBPAPP-869/src/share/classes/org/apache/catalina/loader/WebappClassLoader.java 2008-10-10 16:08:30 UTC (rev 809)
@@ -111,7 +111,14 @@
public static final boolean ENABLE_CLEAR_REFERENCES =
Boolean.valueOf(System.getProperty("org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES", "true")).booleanValue();
-
+
+ public static final boolean SYSTEM_CL_DELEGATION =
+ Boolean.valueOf(System.getProperty("org.apache.catalina.loader.WebappClassLoader.SYSTEM_CL_DELEGATION", "true")).booleanValue();
+
+ /** A list of packages that define system classes */
+ public static final String SYSTEM_CLASS_PATTERNS =
+ System.getProperty("org.apache.catalina.loader.SYSTEM_CLASS_PATTERNS", "java.,javax.,org.ietf.jgss,org.w3c.dom,org.xml.sax");
+
protected class PrivilegedFindResource
implements PrivilegedAction {
@@ -1269,15 +1276,17 @@
// (0.2) Try loading the class with the system class loader, to prevent
// the webapp from overriding J2SE classes
- try {
- clazz = system.loadClass(name);
- if (clazz != null) {
- if (resolve)
- resolveClass(clazz);
- return (clazz);
- }
- } catch (ClassNotFoundException e) {
- // Ignore
+ if (SYSTEM_CL_DELEGATION) {
+ try {
+ clazz = system.loadClass(name);
+ if (clazz != null) {
+ if (resolve)
+ resolveClass(clazz);
+ return (clazz);
+ }
+ } catch (ClassNotFoundException e) {
+ // Ignore
+ }
}
// (0.5) Permission to access this class when using a SecurityManager
16 years, 3 months