Author: remy.maucherat(a)jboss.com
Date: 2008-12-29 06:42:28 -0500 (Mon, 29 Dec 2008)
New Revision: 886
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
Log:
- No URL escaping in path name for context.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2008-12-29 11:41:03 UTC (rev
885)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2008-12-29 11:42:28 UTC (rev
886)
@@ -1557,7 +1557,7 @@
*/
public void setPath(String path) {
// XXX Use host in name
- setName(RequestUtil.URLDecode(path));
+ setName(path);
}
Modified: trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
===================================================================
--- trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java 2008-12-29 11:41:03 UTC
(rev 885)
+++ trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java 2008-12-29 11:42:28 UTC
(rev 886)
@@ -44,6 +44,7 @@
import org.apache.catalina.manager.util.SessionUtils;
import org.apache.catalina.util.RequestUtil;
import org.apache.catalina.util.ServerInfo;
+import org.apache.catalina.util.URLEncoder;
import org.apache.tomcat.util.http.fileupload.DiskFileUpload;
import org.apache.tomcat.util.http.fileupload.FileItem;
@@ -72,10 +73,16 @@
public final class HTMLManagerServlet extends ManagerServlet {
+ protected static final URLEncoder URL_ENCODER;
protected static final String APPLICATION_MESSAGE = "message";
protected static final String APPLICATION_ERROR = "error";
protected String sessionsListJspPath = "/sessionsList.jsp";
protected String sessionDetailJspPath = "/sessionDetail.jsp";
+ static {
+ URL_ENCODER = new URLEncoder();
+ // '/' should not be encoded in context paths
+ URL_ENCODER.addSafeCharacter('/');
+ }
// --------------------------------------------------------- Public Methods
@@ -397,24 +404,26 @@
isDeployed = false;
}
- args = new Object[6];
- args[0] = displayPath;
- args[1] = context.getDisplayName();
- if (args[1] == null) {
- args[1] = " ";
+ args = new Object[7];
+ args[0] = URL_ENCODER.encode(displayPath);
+ args[1] = displayPath;
+ args[2] = context.getDisplayName();
+ if (args[2] == null) {
+ args[2] = " ";
}
- args[2] = new Boolean(context.getAvailable());
- args[3] = response.encodeURL
+ args[3] = new Boolean(context.getAvailable());
+ args[4] = response.encodeURL
(request.getContextPath() +
- "/html/sessions?path=" + displayPath);
+ "/html/sessions?path=" +
URL_ENCODER.encode(displayPath));
if (context.getManager() != null) {
- args[4] = new Integer
+ args[5] = new Integer
(context.getManager().getActiveSessions());
} else {
- args[4] = new Integer(0);
+ args[5] = new Integer(0);
}
- args[5] = highlightStyle;
+ args[6] = highlightStyle;
+
writer.print
(MessageFormat.format(APPS_ROW_DETAILS_SECTION, args));
@@ -967,11 +976,11 @@
" </tr>\n";
private static final String APPS_ROW_DETAILS_SECTION =
- "<tr class=\"{5}\">\n" +
- " <td class=\"first\" rowspan=\"2\"><a
href=\"{0}\">{0}</a></td>\n" +
- " <td rowspan=\"2\">{1}</td>\n" +
+ "<tr class=\"{6}\">\n" +
+ " <td class=\"first\" rowspan=\"2\"><a
href=\"{0}\">{1}</a></td>\n" +
" <td rowspan=\"2\">{2}</td>\n" +
- " <td rowspan=\"2\"><a href=\"{3}\"
target=\"_new\">{4}</a></td>\n";
+ " <td rowspan=\"2\">{3}</td>\n" +
+ " <td rowspan=\"2\"><a href=\"{4}\"
target=\"_new\">{5}</a></td>\n";
private static final String MANAGER_APP_ROW_BUTTON_SECTION =
" <td>\n" +
Show replies by date