Author: fhanik
Date: Wed Aug 13 20:10:28 2008
New Revision: 685757
URL: http://svn.apache.org/viewvc?rev=685757&view=rev
Log:
apply patches
Modified:
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/HostConfig.java
tomcat/container/tc5.5.x/webapps/docs/changelog.xml
tomcat/container/tc5.5.x/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/HTMLManagerServlet.java
tomcat/container/tc5.5.x/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/ManagerServlet.java
tomcat/current/tc5.5.x/STATUS.txt
Modified:
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
URL:
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java?rev=685757&r1=685756&r2=685757&view=diff
==============================================================================
---
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
(original)
+++
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
Wed Aug 13 20:10:28 2008
@@ -855,9 +855,13 @@
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() + "!/");
+ URL war = new URL("jar:" + (new File(docBase)).toURI().toURL() +
"!/");
docBase = ExpandWar.expand(host, war, contextPath);
file = new File(docBase);
docBase = file.getCanonicalPath();
@@ -870,7 +874,8 @@
File warFile = new File(docBase + ".war");
if (warFile.exists()) {
if (unpackWARs) {
- URL war = new URL("jar:" + warFile.toURL() + "!/");
+ URL war =
+ new URL("jar:" + warFile.toURI().toURL() + "!/");
docBase = ExpandWar.expand(host, war, contextPath);
file = new File(docBase);
docBase = file.getCanonicalPath();
Modified:
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/HostConfig.java
URL:
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/HostConfig.java?rev=685757&r1=685756&r2=685757&view=diff
==============================================================================
---
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/HostConfig.java
(original)
+++
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/HostConfig.java
Wed Aug 13 20:10:28 2008
@@ -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");
@@ -705,7 +705,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);
@@ -843,6 +843,7 @@
name = path;
}
}
+ name = name.replace('/', '#');
File docBase = new File(name);
if (!docBase.isAbsolute()) {
docBase = new File(appBase(), name);
@@ -879,7 +880,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 = "";
Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=685757&r1=685756&r2=685757&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Wed Aug 13 20:10:28 2008
@@ -43,6 +43,9 @@
<subsection name="Catalina">
<changelog>
<fix>
+ <bug>44021</bug>, <bug>43013</bug>: Add support for # to signify
multi-level contexts for directories and wars.
+ </fix>
+ <fix>
<bug>44494</bug>: Backport from 6.0 (rjung)
</fix>
<fix>
Modified:
tomcat/container/tc5.5.x/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/HTMLManagerServlet.java
URL:
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/HTMLManagerServlet.java?rev=685757&r1=685756&r2=685757&view=diff
==============================================================================
---
tomcat/container/tc5.5.x/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/HTMLManagerServlet.java
(original)
+++
tomcat/container/tc5.5.x/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/HTMLManagerServlet.java
Wed Aug 13 20:10:28 2008
@@ -202,7 +202,7 @@
if (basename.equals("ROOT")) {
path = "";
} else {
- path = "/" + basename;
+ path = "/" + basename.replace('#', '/');
}
if ((host.findChild(path) != null) && !isDeployed(path)) {
message = sm.getString
Modified:
tomcat/container/tc5.5.x/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/ManagerServlet.java
URL:
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/ManagerServlet.java?rev=685757&r1=685756&r2=685757&view=diff
==============================================================================
---
tomcat/container/tc5.5.x/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/ManagerServlet.java
(original)
+++
tomcat/container/tc5.5.x/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/ManagerServlet.java
Wed Aug 13 20:10:28 2008
@@ -1289,6 +1289,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");
@@ -1300,9 +1303,9 @@
xml.delete();
}
// Perform new deployment
- check(path);
+ check(path.replace('#', '/'));
} finally {
- removeServiced(path);
+ removeServiced(path.replace('#','/'));
}
}
writer.println(sm.getString("managerServlet.undeployed",
@@ -1334,14 +1337,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: tomcat/current/tc5.5.x/STATUS.txt
URL:
http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=685757&r1=685756&r2=685757&view=diff
==============================================================================
--- tomcat/current/tc5.5.x/STATUS.txt (original)
+++ tomcat/current/tc5.5.x/STATUS.txt Wed Aug 13 20:10:28 2008
@@ -49,14 +49,6 @@
+1: markt, yoavs, fhanik
-1:
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=44021
- and https://issues.apache.org/bugzilla/show_bug.cgi?id=43013
- Add support for # to signify multi-level contexts for directories and
- wars.
- http://svn.apache.org/viewvc?rev=653549&view=rev
- +1: markt, yoavs, fhanik
- -1:
-
* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42899
When saving config from admin app, correctly handle case where old config
file
does not exist.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]