When using the WebDAV servlet, the log shows java.io.UnsupportedEncodingException: UTF_8 exceptions on requests. Reproduction steps; - Download and unzip tomcat version 7.0.81 - Unzip the webdav.zip webdav in the root of the tomcat. - Start the Tomcat server - Connect with anyclient to http://localhost:8080/webdav/ - See the stacktrace in the console. java.io.UnsupportedEncodingException: UTF_8 at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:61) at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:100) at org.apache.catalina.util.URLEncoder.encode(URLEncoder.java:170) at org.apache.catalina.servlets.WebdavServlet.rewriteUrl(WebdavServlet.java:444) at org.apache.catalina.servlets.WebdavServlet.parseProperties(WebdavServlet.java:2122) at org.apache.catalina.servlets.WebdavServlet.doPropfind(WebdavServlet.java:702) <SNIP> I have traced this to org.apache.catalina.servlets.WebdavServlet.rewriteUrl(String) . The implementation for tc7.x is; return URL_ENCODER_XML.encode(path, "UTF_8"); For tc8.5 it is; return URL_ENCODER_XML.encode(path, StandardCharsets.UTF_8); I suspect that this is a pretty simple copy-paste error. The string should probably be changed from "UTF_8" (with underscore) to "UTF-8" (with a dash). But i have not tested this.
Created attachment 35252 [details] webdav webapps folder to ease reproduction
Fixed in: - 8.0.x for 8.0.47 onwards - 7.0.x for 7.0.82 onwards Thanks for the report. 8.0.x was affected too as were a couple of tests.