JBossWeb SVN: r732 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-29 11:41:07 -0400 (Tue, 29 Jul 2008)
New Revision: 732
Modified:
trunk/java/org/apache/catalina/realm/JDBCRealm.java
trunk/webapps/docs/changelog.xml
Log:
- Port patch: sync getPrincipal.
Modified: trunk/java/org/apache/catalina/realm/JDBCRealm.java
===================================================================
--- trunk/java/org/apache/catalina/realm/JDBCRealm.java 2008-07-25 16:29:30 UTC (rev 731)
+++ trunk/java/org/apache/catalina/realm/JDBCRealm.java 2008-07-29 15:41:07 UTC (rev 732)
@@ -38,10 +38,9 @@
* See the JDBCRealm.howto for more details on how to set up the database and
* for configuration options.
*
-* <p><strong>TODO</strong> - Support connection pooling (including message
-* format objects) so that <code>authenticate()</code>,
-* <code>getPassword()</code> and <code>authenticate()</code> do not have to be
-* synchronized and would fix the ugly connection logic. </p>
+* <p><strong>NOTE</strong>: This realm features simple configuration, but
+* uses a single connection to the database. In cases where authentication
+* becomes a bottleneck, the DataSource realm must be used instead.</p>
*
* @author Craig R. McClanahan
* @author Carson McDonald
@@ -591,7 +590,7 @@
/**
* Return the Principal associated with the given user name.
*/
- protected Principal getPrincipal(String username) {
+ protected synchronized Principal getPrincipal(String username) {
return (new GenericPrincipal(this,
username,
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-07-25 16:29:30 UTC (rev 731)
+++ trunk/webapps/docs/changelog.xml 2008-07-29 15:41:07 UTC (rev 732)
@@ -16,6 +16,16 @@
<body>
+<section name="JBoss Web 2.1.1.CR6 (remm)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ <bug>45453</bug>: Sync getPrincipal in JDBCRealm. (markt)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
+
<section name="JBoss Web 2.1.1.CR5 (remm)">
<subsection name="General">
<changelog>
16 years, 4 months
JBossWeb SVN: r731 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/connector.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-25 12:29:30 -0400 (Fri, 25 Jul 2008)
New Revision: 731
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/connector/CoyoteAdapter.java
Log:
Add checkNormalize method to verify that the URI is still normalized after character decoding.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/connector/CoyoteAdapter.java 2008-07-25 16:26:00 UTC (rev 730)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/connector/CoyoteAdapter.java 2008-07-25 16:29:30 UTC (rev 731)
@@ -351,6 +351,12 @@
}
// Character decoding
convertURI(decodedURI, request);
+ // Check that the URI is still normalized
+ if (!checkNormalize(req.decodedURI())) {
+ res.setStatus(400);
+ res.setMessage("Invalid URI character encoding");
+ return false;
+ }
} else {
// The URL is chars or String, and has been sent using an in-memory
// protocol handler, we have to assume the URL has been properly
@@ -715,6 +721,67 @@
}
+ /**
+ * Check that the URI is normalized following character decoding.
+ * <p>
+ * This method checks for "\", "//", "/./" and "/../". This method will
+ * return false if sequences that are supposed to be normalized still
+ * present in the URI.
+ *
+ * @param uriMB URI to be normalized
+ */
+ public static boolean checkNormalize(MessageBytes uriMB) {
+
+ CharChunk uriCC = uriMB.getCharChunk();
+ char[] c = uriCC.getChars();
+ int start = uriCC.getStart();
+ int end = uriCC.getEnd();
+
+ int pos = 0;
+
+ // Check for '\' and for null byte
+ for (pos = start; pos < end; pos++) {
+ if (c[pos] == '\\') {
+ return false;
+ }
+ if (c[pos] == 0) {
+ return false;
+ }
+ }
+
+ // Check for "//"
+ for (pos = start; pos < (end - 1); pos++) {
+ if (c[pos] == '/') {
+ if (c[pos + 1] == '/') {
+ return false;
+ }
+ }
+ }
+
+ // Check for URI ending with "/." or "/.."
+ if (((end - start) >= 2) && (c[end - 1] == '.')) {
+ if ((c[end - 2] == '/')
+ || ((c[end - 2] == '.')
+ && (c[end - 3] == '/'))) {
+ return false;
+ }
+ }
+
+ // Check for "/./"
+ if (uriCC.indexOf("/./", 0, 3, 0) >= 0) {
+ return false;
+ }
+
+ // Check for "/./"
+ if (uriCC.indexOf("/../", 0, 4, 0) >= 0) {
+ return false;
+ }
+
+ return true;
+
+ }
+
+
// ------------------------------------------------------ Protected Methods
16 years, 5 months
JBossWeb SVN: r730 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/host.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-25 12:26:00 -0400 (Fri, 25 Jul 2008)
New Revision: 730
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
Log:
Very minor XSS problem.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/host/HTMLHostManagerServlet.java 2008-07-25 16:14:15 UTC (rev 729)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/host/HTMLHostManagerServlet.java 2008-07-25 16:26:00 UTC (rev 730)
@@ -21,6 +21,7 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
+import java.net.URLEncoder;
import java.text.MessageFormat;
import java.util.Iterator;
import java.util.Map;
@@ -276,17 +277,17 @@
args = new Object[7];
args[0] = response.encodeURL
(request.getContextPath() +
- "/html/start?name=" + hostName);
+ "/html/start?name=" + URLEncoder.encode(hostName, "UTF-8"));
args[1] = hostsStart;
args[2] = response.encodeURL
(request.getContextPath() +
- "/html/stop?name=" + hostName);
+ "/html/stop?name=" + URLEncoder.encode(hostName, "UTF-8"));
args[3] = hostsStop;
args[4] = response.encodeURL
(request.getContextPath() +
- "/html/remove?name=" + hostName);
+ "/html/remove?name=" + URLEncoder.encode(hostName, "UTF-8"));
args[5] = hostsRemove;
- args[6] = hostName;
+ args[6] = RequestUtil.filter(hostName);
if (host == this.host) {
writer.print(MessageFormat.format(
MANAGER_HOST_ROW_BUTTON_SECTION, args));
16 years, 5 months
JBossWeb SVN: r729 - in branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina: startup and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-25 12:14:15 -0400 (Fri, 25 Jul 2008)
New Revision: 729
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/HTMLManagerServlet.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/ManagerServlet.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/startup/ContextConfig.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/startup/HostConfig.java
Log:
Fix minor possible 2008-XXX.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/HTMLManagerServlet.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/HTMLManagerServlet.java 2008-07-25 13:48:38 UTC (rev 728)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/HTMLManagerServlet.java 2008-07-25 16:14:15 UTC (rev 729)
@@ -202,7 +202,7 @@
if (basename.equals("ROOT")) {
path = "";
} else {
- path = "/" + basename;
+ path = "/" + basename.replace('#', '/');
}
if (!isServiced(path)) {
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/ManagerServlet.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/ManagerServlet.java 2008-07-25 13:48:38 UTC (rev 728)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/ManagerServlet.java 2008-07-25 16:14:15 UTC (rev 729)
@@ -1293,6 +1293,9 @@
// Ignore
}
try {
+ if (path.lastIndexOf('/') > 0) {
+ path = "/" + path.substring(1).replace('/','#');
+ }
File war = new File(getAppBase(), getDocBase(path) + ".war");
File dir = new File(getAppBase(), getDocBase(path));
File xml = new File(configBase, getConfigFile(path) + ".xml");
@@ -1304,9 +1307,9 @@
xml.delete();
}
// Perform new deployment
- check(path);
+ check(path.replace('#', '/'));
} finally {
- removeServiced(path);
+ removeServiced(path.replace('#','/'));
}
}
writer.println(sm.getString("managerServlet.undeployed",
@@ -1338,14 +1341,14 @@
/**
- * Given a context path, get the config file name.
+ * Given a context path, get the doc base.
*/
protected String getDocBase(String path) {
String basename = null;
if (path.equals("")) {
basename = "ROOT";
} else {
- basename = path.substring(1);
+ basename = path.substring(1).replace('/', '#');
}
return (basename);
}
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/startup/ContextConfig.java 2008-07-25 13:48:38 UTC (rev 728)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/startup/ContextConfig.java 2008-07-25 16:14:15 UTC (rev 729)
@@ -881,12 +881,16 @@
file = new File(docBase);
String origDocBase = docBase;
+ String contextPath = context.getPath();
+ if (contextPath.equals("")) {
+ contextPath = "ROOT";
+ } else {
+ if (contextPath.lastIndexOf('/') > 0) {
+ contextPath = "/" + contextPath.substring(1).replace('/','#');
+ }
+ }
if (docBase.toLowerCase().endsWith(".war") && !file.isDirectory() && unpackWARs) {
- URL war = new URL("jar:" + (new File(docBase)).toURL() + "!/");
- String contextPath = context.getPath();
- if (contextPath.equals("")) {
- contextPath = "ROOT";
- }
+ URL war = new URL("jar:" + (new File(docBase)).toURI().toURL() + "!/");
docBase = ExpandWar.expand(host, war, contextPath);
file = new File(docBase);
docBase = file.getCanonicalPath();
@@ -899,8 +903,9 @@
File warFile = new File(docBase + ".war");
if (warFile.exists()) {
if (unpackWARs) {
- URL war = new URL("jar:" + warFile.toURL() + "!/");
- docBase = ExpandWar.expand(host, war, context.getPath());
+ URL war =
+ new URL("jar:" + warFile.toURI().toURL() + "!/");
+ docBase = ExpandWar.expand(host, war, contextPath);
file = new File(docBase);
docBase = file.getCanonicalPath();
} else {
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/startup/HostConfig.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/startup/HostConfig.java 2008-07-25 13:48:38 UTC (rev 728)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/startup/HostConfig.java 2008-07-25 16:14:15 UTC (rev 729)
@@ -463,14 +463,14 @@
/**
- * Given a context path, get the config file name.
+ * Given a context path, get the docBase.
*/
protected String getDocBase(String path) {
String basename = null;
if (path.equals("")) {
basename = "ROOT";
} else {
- basename = path.substring(1);
+ basename = path.substring(1).replace('/', '#');
}
return (basename);
}
@@ -503,7 +503,7 @@
File appBase = appBase();
File configBase = configBase();
String baseName = getConfigFile(name);
- String docBase = getConfigFile(name);
+ String docBase = getDocBase(name);
// Deploy XML descriptors from configBase
File xml = new File(configBase, baseName + ".xml");
@@ -699,7 +699,7 @@
if (files[i].toLowerCase().endsWith(".war")) {
// Calculate the context path and make sure it is unique
- String contextPath = "/" + files[i];
+ String contextPath = "/" + files[i].replace('#','/');
int period = contextPath.lastIndexOf(".");
if (period >= 0)
contextPath = contextPath.substring(0, period);
@@ -837,6 +837,7 @@
name = path;
}
}
+ name = name.replace('/', '#');
File docBase = new File(name);
if (!docBase.isAbsolute()) {
docBase = new File(appBase(), name);
@@ -873,7 +874,7 @@
if (dir.isDirectory()) {
// Calculate the context path and make sure it is unique
- String contextPath = "/" + files[i];
+ String contextPath = "/" + files[i].replace('#','/');
if (files[i].equals("ROOT"))
contextPath = "";
16 years, 5 months
JBossWeb SVN: r728 - in branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager: host and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-25 09:48:38 -0400 (Fri, 25 Jul 2008)
New Revision: 728
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/HTMLManagerServlet.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
Log:
Fix the 2007-2450 and 2007-3386 (Just to make security people happy the
servlet is configured in JBossAS so it won't be used).
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/HTMLManagerServlet.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/HTMLManagerServlet.java 2008-07-25 11:53:28 UTC (rev 727)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/HTMLManagerServlet.java 2008-07-25 13:48:38 UTC (rev 728)
@@ -107,8 +107,7 @@
message = stop(path);
} else {
message =
- sm.getString("managerServlet.unknownCommand",
- RequestUtil.filter(command));
+ sm.getString("managerServlet.unknownCommand", command);
}
list(request, response, message);
@@ -282,7 +281,11 @@
// Message Section
args = new Object[3];
args[0] = sm.getString("htmlManagerServlet.messageLabel");
- args[1] = (message == null || message.length() == 0) ? "OK" : message;
+ if (message == null || message.length() == 0) {
+ args[1] = "OK";
+ } else {
+ args[1] = RequestUtil.filter(message);
+ }
writer.print(MessageFormat.format(Constants.MESSAGE_SECTION, args));
// Manager Section
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/host/HTMLHostManagerServlet.java 2008-07-25 11:53:28 UTC (rev 727)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/manager/host/HTMLHostManagerServlet.java 2008-07-25 13:48:38 UTC (rev 728)
@@ -32,6 +32,7 @@
import org.apache.catalina.Container;
import org.apache.catalina.Host;
+import org.apache.catalina.util.RequestUtil;
import org.apache.catalina.util.ServerInfo;
/**
@@ -195,7 +196,11 @@
// Message Section
args = new Object[3];
args[0] = sm.getString("htmlHostManagerServlet.messageLabel");
- args[1] = (message == null || message.length() == 0) ? "OK" : message;
+ if (message == null || message.length() == 0) {
+ args[1] = "OK";
+ } else {
+ args[1] = RequestUtil.filter(message);
+ }
writer.print(MessageFormat.format(Constants.MESSAGE_SECTION, args));
// Manager Section
@@ -248,7 +253,7 @@
if (host != null ) {
args = new Object[2];
- args[0] = hostName;
+ args[0] = RequestUtil.filter(hostName);
String[] aliases = host.findAliases();
StringBuffer buf = new StringBuffer();
if (aliases.length > 0) {
@@ -260,9 +265,11 @@
if (buf.length() == 0) {
buf.append(" ");
+ args[1] = buf.toString();
+ } else {
+ args[1] = buf.toString();
}
- args[1] = buf.toString();
writer.print
(MessageFormat.format(HOSTS_ROW_DETAILS_SECTION, args));
16 years, 5 months
JBossWeb SVN: r727 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-25 07:53:28 -0400 (Fri, 25 Jul 2008)
New Revision: 727
Added:
tags/JBOSSWEB_2_1_1_CR5/
Log:
- JBoss Web 2.1.1.CR5.
Copied: tags/JBOSSWEB_2_1_1_CR5 (from rev 726, trunk)
16 years, 5 months
JBossWeb SVN: r726 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-23 13:28:10 -0400 (Wed, 23 Jul 2008)
New Revision: 726
Modified:
trunk/build.properties.default
trunk/webapps/docs/changelog.xml
Log:
- Update various dependencies.
Modified: trunk/build.properties.default
===================================================================
--- trunk/build.properties.default 2008-07-23 12:43:59 UTC (rev 725)
+++ trunk/build.properties.default 2008-07-23 17:28:10 UTC (rev 726)
@@ -39,8 +39,8 @@
# ----- Eclipse JDT, version 3.2 or later -----
jdt.home=${base.path}/eclipse/plugins
jdt.lib=${jdt.home}
-jdt.jar=${jdt.lib}/org.eclipse.jdt.core_3.3.3.v_793_R33x.jar
-jdt.loc=http://download.eclipse.org/eclipse/downloads/drops/R-3.3.2-200802211800/eclipse-JDT-3.3.2.zip
+jdt.jar=${jdt.lib}/org.eclipse.jdt.core_3.4.0.v_874.jar
+jdt.loc=http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/eclipse-JDT-3.4.zip
# ----- Commons DBCP, version 1.1 or later -----
commons-dbcp.version=1.2.2
@@ -52,25 +52,25 @@
commons-pool-src.loc=${base-commons.loc}/pool/source/commons-pool-1.4-src.tar.gz
# ----- Commons Collections, version 2.0 or later -----
-commons-collections.home=${base.path}/commons-collections-3.2-src
+commons-collections.home=${base.path}/commons-collections-3.2.1-src
commons-collections.lib=${commons-collections.home}
-commons-collections.jar=${commons-collections.lib}/commons-collections-3.2.jar
-commons-collections.loc=${base-jakarta.loc}/commons/collections/binaries/commons-collections-3.2.tar.gz
-commons-collections-src.loc=${base-commons.loc}/collections/source/commons-collections-3.2-src.tar.gz
+commons-collections.jar=${commons-collections.lib}/commons-collections-3.2.1.jar
+commons-collections.loc=${base-jakarta.loc}/commons/collections/binaries/commons-collections-3.2.1.tar.gz
+commons-collections-src.loc=${base-commons.loc}/collections/source/commons-collections-3.2.1-src.tar.gz
# ----- NSIS, version 2.0 or later -----
-nsis.home=${base.path}/nsis-2.37
+nsis.home=${base.path}/nsis-2.38
nsis.exe=${nsis.home}/makensis.exe
nsis.installoptions.dll=${nsis.home}/Plugins/InstallOptions.dll
nsis.nsexec.dll=${nsis.home}/Plugins/nsExec.dll
nsis.nsisdl.dll=${nsis.home}/Plugins/NSISdl.dll
-nsis.loc=${base-sf.loc}/nsis/nsis-2.37.zip
+nsis.loc=${base-sf.loc}/nsis/nsis-2.38.zip
# ----- JBoss Native, version 2.0 or later -----
-jbossnative.home=${base.path}/jboss-native-2.0.3
-jbossnative.openssl=${base.path}/jboss-native-2.0.3/bin/openssl.exe
-jbossnative.dlls=${jbossnative.home}/bin/native
-jbossnative.loc=http://labs.jboss.com/downloading/?projectId=jbossweb&url=http://labs.jboss.com/file-access/default/members/jbossweb/freezone/dist/2.0.3.GA/jboss-native-2.0.3-windows-i686-ssl.zip
+jbossnative.home=${base.path}/jboss-native-2.0.4
+jbossnative.openssl=${jbossnative.home}/bin/META-INF/bin/windows/x86/openssl.exe
+jbossnative.dlls=${jbossnative.home}/bin/META-INF/lib/windows/x86
+jbossnative.loc=http://www.jboss.org/downloading/?projectId=jbossweb&url=http://labs.jboss.com/file-access/default/members/jbossweb/freezone/dist/2.0.4.GA/jboss-native-2.0.4-windows-x86-ssl.zip
# ----- Commons Daemon, version 1.0-Alpha or later -----
commons-daemon.home=${base.path}/commons-daemon-1.0.1
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-07-23 12:43:59 UTC (rev 725)
+++ trunk/webapps/docs/changelog.xml 2008-07-23 17:28:10 UTC (rev 726)
@@ -23,6 +23,18 @@
<bug>45332</bug>: Don't assume UTF-8 and use the correct encoding when generating
tomcat-users.xml from the Windows installer. (markt)
</fix>
+ <update>
+ NSIS 2.38. (remm)
+ </update>
+ <update>
+ JBoss Native 2.0.4. (remm)
+ </update>
+ <update>
+ Commons Collections 3.2.1. (remm)
+ </update>
+ <update>
+ Eclipse JDT 3.4. (remm)
+ </update>
</changelog>
</subsection>
<subsection name="Catalina">
16 years, 5 months
JBossWeb SVN: r725 - in trunk: java/org/apache/jasper/compiler and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-23 08:43:59 -0400 (Wed, 23 Jul 2008)
New Revision: 725
Modified:
trunk/java/org/apache/jasper/Constants.java
trunk/java/org/apache/jasper/compiler/Generator.java
trunk/java/org/apache/jasper/runtime/TagHandlerPool.java
trunk/webapps/docs/changelog.xml
trunk/webapps/docs/sysprops.xml
Log:
- Add system property to disable tag injection.
Modified: trunk/java/org/apache/jasper/Constants.java
===================================================================
--- trunk/java/org/apache/jasper/Constants.java 2008-07-22 14:04:03 UTC (rev 724)
+++ trunk/java/org/apache/jasper/Constants.java 2008-07-23 12:43:59 UTC (rev 725)
@@ -196,6 +196,9 @@
public static final boolean USE_INSTANCE_MANAGER_FOR_TAGS =
Boolean.valueOf(System.getProperty("org.apache.jasper.Constants.USE_INSTANCE_MANAGER_FOR_TAGS", "false")).booleanValue();
+ public static final boolean INJECT_TAGS =
+ Boolean.valueOf(System.getProperty("org.apache.jasper.Constants.INJECT_TAGS", "true")).booleanValue();
+
/**
* The name of the path parameter used to pass the session identifier
* back and forth with the client.
Modified: trunk/java/org/apache/jasper/compiler/Generator.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Generator.java 2008-07-22 14:04:03 UTC (rev 724)
+++ trunk/java/org/apache/jasper/compiler/Generator.java 2008-07-23 12:43:59 UTC (rev 725)
@@ -2252,18 +2252,22 @@
out.print("new ");
out.print(tagHandlerClassName);
out.println("());");
- out.printin(VAR_INSTANCEMANAGER);
- out.print(".newInstance(");
- out.print(tagHandlerVar);
- out.println(");");
+ if (Constants.INJECT_TAGS) {
+ out.printin(VAR_INSTANCEMANAGER);
+ out.print(".newInstance(");
+ out.print(tagHandlerVar);
+ out.println(");");
+ }
}
}
private void writeDestroyInstance(String tagHandlerVar) {
- out.printin(VAR_INSTANCEMANAGER);
- out.print(".destroyInstance(");
- out.print(tagHandlerVar);
- out.println(");");
+ if (Constants.INJECT_TAGS) {
+ out.printin(VAR_INSTANCEMANAGER);
+ out.print(".destroyInstance(");
+ out.print(tagHandlerVar);
+ out.println(");");
+ }
}
private void generateCustomEnd(Node.CustomTag n, String tagHandlerVar,
Modified: trunk/java/org/apache/jasper/runtime/TagHandlerPool.java
===================================================================
--- trunk/java/org/apache/jasper/runtime/TagHandlerPool.java 2008-07-22 14:04:03 UTC (rev 724)
+++ trunk/java/org/apache/jasper/runtime/TagHandlerPool.java 2008-07-23 12:43:59 UTC (rev 725)
@@ -126,7 +126,9 @@
return (Tag) instanceManager.newInstance(handlerClass.getName(), handlerClass.getClassLoader());
} else {
Tag instance = (Tag) handlerClass.newInstance();
- instanceManager.newInstance(instance);
+ if (Constants.INJECT_TAGS) {
+ instanceManager.newInstance(instance);
+ }
return instance;
}
} catch (Exception e) {
@@ -150,11 +152,13 @@
}
// There is no need for other threads to wait for us to release
handler.release();
- try {
- instanceManager.destroyInstance(handler);
- } catch (Exception e) {
- log.warn("Error processing preDestroy on tag instance of "
- + handler.getClass().getName(), e);
+ if (Constants.INJECT_TAGS) {
+ try {
+ instanceManager.destroyInstance(handler);
+ } catch (Exception e) {
+ log.warn("Error processing preDestroy on tag instance of "
+ + handler.getClass().getName(), e);
+ }
}
}
@@ -165,11 +169,13 @@
public synchronized void release() {
for (int i = current; i >= 0; i--) {
handlers[i].release();
- try {
- instanceManager.destroyInstance(handlers[i]);
- } catch (Exception e) {
- log.warn("Error processing preDestroy on tag instance of "
- + handlers[i].getClass().getName(), e);
+ if (Constants.INJECT_TAGS) {
+ try {
+ instanceManager.destroyInstance(handlers[i]);
+ } catch (Exception e) {
+ log.warn("Error processing preDestroy on tag instance of "
+ + handlers[i].getClass().getName(), e);
+ }
}
}
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-07-22 14:04:03 UTC (rev 724)
+++ trunk/webapps/docs/changelog.xml 2008-07-23 12:43:59 UTC (rev 725)
@@ -73,6 +73,9 @@
<jira>110</jira>: Remove the per request logging of everything in JSP Servlet, which caused
i18n issues. (remm)
</fix>
+ <update>
+ Add a system property to disable injection for tags. (remm)
+ </update>
</changelog>
</subsection>
<subsection name="Native">
Modified: trunk/webapps/docs/sysprops.xml
===================================================================
--- trunk/webapps/docs/sysprops.xml 2008-07-22 14:04:03 UTC (rev 724)
+++ trunk/webapps/docs/sysprops.xml 2008-07-23 12:43:59 UTC (rev 725)
@@ -239,6 +239,12 @@
handler instances. If not specified, <code>false</code> will be used.</p>
</property>
+ <property name="org.apache.jasper.Constants. USE_INSTANCE_MANAGER_FOR_TAGS">
+ <p>If <code>true</code>, annotations specified in tags will be processed and
+ injected. This can have a performance impact when using simple tags, or if tag
+ pooling is disabled. If not specified, <code>true</code> will be used.</p>
+ </property>
+
</properties>
</section>
16 years, 5 months
JBossWeb SVN: r724 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-22 10:04:03 -0400 (Tue, 22 Jul 2008)
New Revision: 724
Modified:
trunk/java/org/apache/jasper/servlet/JspServlet.java
trunk/webapps/docs/changelog.xml
Log:
- JBWEB-110: Remove per request logging.
Modified: trunk/java/org/apache/jasper/servlet/JspServlet.java
===================================================================
--- trunk/java/org/apache/jasper/servlet/JspServlet.java 2008-07-22 13:17:32 UTC (rev 723)
+++ trunk/java/org/apache/jasper/servlet/JspServlet.java 2008-07-22 14:04:03 UTC (rev 724)
@@ -244,22 +244,6 @@
}
}
- if (log.isDebugEnabled()) {
- log.debug("JspEngine --> " + jspUri);
- log.debug("\t ServletPath: " + request.getServletPath());
- log.debug("\t PathInfo: " + request.getPathInfo());
- log.debug("\t RealPath: " + context.getRealPath(jspUri));
- log.debug("\t RequestURI: " + request.getRequestURI());
- log.debug("\t QueryString: " + request.getQueryString());
- log.debug("\t Request Params: ");
- Enumeration e = request.getParameterNames();
- while (e.hasMoreElements()) {
- String name = (String) e.nextElement();
- log.debug("\t\t " + name + " = "
- + request.getParameter(name));
- }
- }
-
try {
boolean precompile = preCompile(request);
serviceJspFile(request, response, jspUri, null, precompile);
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-07-22 13:17:32 UTC (rev 723)
+++ trunk/webapps/docs/changelog.xml 2008-07-22 14:04:03 UTC (rev 724)
@@ -69,6 +69,10 @@
<fix>
<jira>98</jira>: Remove mandatory usage of URLClassLoader for better integration with AS. (remm)
</fix>
+ <fix>
+ <jira>110</jira>: Remove the per request logging of everything in JSP Servlet, which caused
+ i18n issues. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Native">
16 years, 5 months
JBossWeb SVN: r723 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-07-22 09:17:32 -0400 (Tue, 22 Jul 2008)
New Revision: 723
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/webapps/docs/changelog.xml
Log:
- Add new catalina.work system property, and redo a bit the code to be more consistent.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2008-07-21 11:47:33 UTC (rev 722)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2008-07-22 13:17:32 UTC (rev 723)
@@ -1928,7 +1928,7 @@
}
File workDir = new File(getWorkDir());
if (!workDir.isAbsolute()) {
- File catalinaHome = engineBase();
+ File catalinaHome = workBase();
String catalinaHomePath = null;
try {
catalinaHomePath = catalinaHome.getCanonicalPath();
@@ -4769,6 +4769,16 @@
}
+ protected File workBase() {
+ String base = System.getProperty("catalina.work");
+ if( base == null ) {
+ return engineBase();
+ } else {
+ return (new File(base));
+ }
+ }
+
+
// -------------------------------------------------------- Private Methods
@@ -5092,16 +5102,7 @@
}
// Create this directory if necessary
- File dir = new File(workDir);
- if (!dir.isAbsolute()) {
- File catalinaHome = engineBase();
- String catalinaHomePath = null;
- try {
- catalinaHomePath = catalinaHome.getCanonicalPath();
- dir = new File(catalinaHomePath, workDir);
- } catch (IOException e) {
- }
- }
+ File dir = new File(getWorkPath());
dir.mkdirs();
// Set the appropriate servlet context attribute
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-07-21 11:47:33 UTC (rev 722)
+++ trunk/webapps/docs/changelog.xml 2008-07-22 13:17:32 UTC (rev 723)
@@ -55,6 +55,9 @@
<fix>
Prevent various possible character encoding hacks. (remm)
</fix>
+ <fix>
+ <jira>16</jira>: Add new catalina.work system property to use as the optional base for work folders. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
16 years, 5 months