ProxyDirContext proxyDirContext =
(ProxyDirContext) context;
String hostName = proxyDirContext.getHostName();
- String contextName = proxyDirContext.getContextName();
+ String contextPath = proxyDirContext.getContextPath();
if (hostName != null) {
if (!path.startsWith("/" + hostName + "/"))
return;
path = path.substring(hostName.length()+ 1);
}
- if (contextName != null) {
- if (!path.startsWith(contextName + "/")) {
+ if (contextPath != null) {
+ if (!path.startsWith(contextPath + "/")) {
return;
}
- path = path.substring(contextName.length());
+ path = path.substring(contextPath.length());
}
}
object = context.lookup(path);
// Strip off the hostname and the contextpath
int start;
if(context instanceof ProxyDirContext &&
- "".equals(((ProxyDirContext)context).getContextName())){
+ "".equals(((ProxyDirContext)context).getContextPath())){
start = file.indexOf('/',1);
}
else
}
hostName = env.get(HOST);
contextName = env.get(CONTEXT);
+ int i = contextName.indexOf('#');
+ if (i == -1) {
+ contextPath = contextName;
+ } else {
+ contextPath = contextName.substring(0, i);
+ }
}
/**
+ * Context path.
+ */
+ protected String contextPath;
+
+
+ /**
* Cache class.
*/
protected String cacheClassName =
}
+ /**
+ * Return the context path.
+ */
+ public String getContextPath() {
+ return this.contextPath;
+ }
+
+
// -------------------------------------------------------- Context Methods