Author: remy.maucherat(a)jboss.com
Date: 2010-02-16 21:03:46 -0500 (Tue, 16 Feb 2010)
New Revision: 1389
Modified:
trunk/java/org/apache/catalina/servlets/DefaultServlet.java
trunk/java/org/apache/catalina/servlets/WebdavServlet.java
trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
trunk/java/org/apache/coyote/http11/Http11Processor.java
trunk/webapps/docs/changelog.xml
trunk/webapps/docs/default-servlet.xml
Log:
- Port 3 minor patches.
Modified: trunk/java/org/apache/catalina/servlets/DefaultServlet.java
===================================================================
--- trunk/java/org/apache/catalina/servlets/DefaultServlet.java 2010-02-17 02:02:44 UTC
(rev 1388)
+++ trunk/java/org/apache/catalina/servlets/DefaultServlet.java 2010-02-17 02:03:46 UTC
(rev 1389)
@@ -127,6 +127,12 @@
/**
+ * Allow customized directory listing per context.
+ */
+ protected String contextXsltFile = null;
+
+
+ /**
* Allow customized directory listing per instance.
*/
protected String globalXsltFile = null;
@@ -244,6 +250,7 @@
fileEncoding = getServletConfig().getInitParameter("fileEncoding");
globalXsltFile =
getServletConfig().getInitParameter("globalXsltFile");
+ contextXsltFile =
getServletConfig().getInitParameter("contextXsltFile");
localXsltFile = getServletConfig().getInitParameter("localXsltFile");
readmeFile = getServletConfig().getInitParameter("readmeFile");
@@ -1139,6 +1146,10 @@
trimmed.equalsIgnoreCase(localXsltFile))
continue;
+ if (contextXsltFile != null
+ && (cacheEntry.name + trimmed).equals(contextXsltFile))
+ continue;
+
CacheEntry childCacheEntry =
resources.lookupCache(cacheEntry.name + resourceName);
if (!childCacheEntry.exists) {
@@ -1436,11 +1447,19 @@
} catch (NamingException e) {
if (debug > 10)
log("localXsltFile '" + localXsltFile + "' not
found", e);
-
- return null;
}
}
+ if (contextXsltFile != null) {
+ InputStream is =
+ getServletContext().getResourceAsStream(contextXsltFile);
+ if (is != null)
+ return is;
+
+ if (debug > 10)
+ log("contextXsltFile '" + contextXsltFile + "' not
found");
+ }
+
/* Open and read in file in one fell swoop to reduce chance
* chance of leaving handle open.
*/
Modified: trunk/java/org/apache/catalina/servlets/WebdavServlet.java
===================================================================
--- trunk/java/org/apache/catalina/servlets/WebdavServlet.java 2010-02-17 02:02:44 UTC
(rev 1388)
+++ trunk/java/org/apache/catalina/servlets/WebdavServlet.java 2010-02-17 02:03:46 UTC
(rev 1389)
@@ -2028,6 +2028,11 @@
return;
CacheEntry cacheEntry = resources.lookupCache(path);
+ if (!cacheEntry.exists) {
+ // File is in directory listing but doesn't appear to exist
+ // Broken symlink or odd permission settings?
+ return;
+ }
generatedXML.writeElement(null, "response", XMLWriter.OPENING);
String status = new String("HTTP/1.1 " + WebdavStatus.SC_OK + "
"
Modified: trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2010-02-17 02:02:44 UTC
(rev 1388)
+++ trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2010-02-17 02:03:46 UTC
(rev 1389)
@@ -1722,7 +1722,7 @@
outputBuffer.addActiveFilter(outputFilters[Constants.GZIP_FILTER]);
headers.setValue("Content-Encoding").setString("gzip");
// Make Proxies happy via Vary (from mod_deflate)
- headers.setValue("Vary").setString("Accept-Encoding");
+ headers.addValue("Vary").setString("Accept-Encoding");
}
// Add date header
Modified: trunk/java/org/apache/coyote/http11/Http11Processor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Processor.java 2010-02-17 02:02:44 UTC (rev
1388)
+++ trunk/java/org/apache/coyote/http11/Http11Processor.java 2010-02-17 02:03:46 UTC (rev
1389)
@@ -1605,7 +1605,7 @@
outputBuffer.addActiveFilter(outputFilters[Constants.GZIP_FILTER]);
headers.setValue("Content-Encoding").setString("gzip");
// Make Proxies happy via Vary (from mod_deflate)
- headers.setValue("Vary").setString("Accept-Encoding");
+ headers.addValue("Vary").setString("Accept-Encoding");
}
// Add date header
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-02-17 02:02:44 UTC (rev 1388)
+++ trunk/webapps/docs/changelog.xml 2010-02-17 02:03:46 UTC (rev 1389)
@@ -29,10 +29,22 @@
<bug>48050</bug>: createSubcontext method returns Context with wrong
name. Based on a
suggestion by gingyang.xu. (markt)
</fix>
+ <fix>
+ <bug>48318</bug>: Handle unreadable resources in WebDAV. (markt)
+ </fix>
+ <fix>
+ <jira>19</jira>: Optionally expose principal from Session if present.
(remm)
+ </fix>
+ <fix>
+ <bug>48384</bug>: Per directory XSLT for default servlet. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
<changelog>
+ <fix>
+ <bug>48660</bug>: Add to vary header. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
@@ -47,6 +59,9 @@
<fix>
<bug>48668</bug>: Fix handling of EL like strings when EL is
disabled. (markt)
</fix>
+ <fix>
+ Rebase ELSupport. (remm)
+ </fix>
</changelog>
</subsection>
</section>
Modified: trunk/webapps/docs/default-servlet.xml
===================================================================
--- trunk/webapps/docs/default-servlet.xml 2010-02-17 02:02:44 UTC (rev 1388)
+++ trunk/webapps/docs/default-servlet.xml 2010-02-17 02:03:46 UTC (rev 1389)
@@ -101,19 +101,32 @@
<attribute name="globalXsltFile" required="false">
<p>If you wish to customize your directory listing, you
can use an XSL transformation. This value is an absolute
- file name which be used for all direcotory listings.
- This can be disabled by per webapp by also declaring the
- default servlet in your local webapp's web.xml. The format
- of the xml is shown below.
+ file name which be used for all directory listings.
+ This can be overridden per context and/or per directory. See
+ <strong>contextXsltFile</strong> and
<strong>localXsltFile</strong>
+ below. The format of the xml is shown below.
</p>
</attribute>
+ <attribute name="contextXsltFile" required="false">
+ <p>You may also customize your directory listing by context by
+ configuring <code>contextXsltFile</code>. This should be a context
+ relative path (e.g.: <code>/path/to/context.xslt</code>). This
+ overrides <code>globalXsltFile</code>. If this value is present but
a
+ file does not exist, then <code>globalXsltFile</code> will be used.
If
+ <code>globalXsltFile</code> does not exist, then the default
+ directory listing will be shown.
+ </p>
+ </attribute>
+
<attribute name="localXsltFile" required="false">
<p>You may also customize your directory listing by directory by
configuring <code>localXsltFile</code>. This should be a relative
file name in the directory where the listing will take place.
- This overrides <code>globalXsltFile</code>. If this value
- is present but a file does not exist, then
+ This overrides <code>globalXsltFile</code> and
+ <code>contextXsltFile</code>. If this value is present but a file
+ does not exist, then <code>contextXsltFile</code> will be used. If
+ <code>contextXsltFile</code> does not exist, then
<code>globalXsltFile</code> will be used. If
<code>globalXsltFile</code> does not exist, then the default
directory listing will be shown.</p>
Show replies by date