https://bz.apache.org/bugzilla/show_bug.cgi?id=61452
Bug ID: 61452
Summary: java.io.UnsupportedEncodingException: UTF_8 when using
WebDAV servlet
Product: Tomcat 7
Version: 7.0.81
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
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.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]