Author: markt
Date: Wed Jul 6 15:42:44 2016
New Revision: 1751702
URL: http://svn.apache.org/viewvc?rev=1751702&view=rev
Log:
When writing out a full web.xml file with JspC ensure that the encoding used in
the XML prolog matches the encoding used to write the contents of the file.
Modified:
tomcat/trunk/java/org/apache/jasper/JspC.java
tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties
tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_es.properties
tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_fr.properties
tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_ja.properties
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/java/org/apache/jasper/JspC.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/JspC.java?rev=1751702&r1=1751701&r2=1751702&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/JspC.java (original)
+++ tomcat/trunk/java/org/apache/jasper/JspC.java Wed Jul 6 15:42:44 2016
@@ -230,7 +230,7 @@ public class JspC extends Task implement
// Generation of web.xml fragments
protected String webxmlFile;
protected int webxmlLevel;
- protected String webxmlEncoding;
+ protected String webxmlEncoding = "UTF-8";
protected boolean addWebXmlMappings = false;
protected Writer mapout;
@@ -983,7 +983,7 @@ public class JspC extends Task implement
* Sets the encoding to be used to read and write web.xml files.
*
* <p>
- * If not specified, defaults to the platform default encoding.
+ * If not specified, defaults to UTF-8.
* </p>
*
* @param encoding
@@ -1473,7 +1473,7 @@ public class JspC extends Task implement
mappingout = null;
}
if (webxmlLevel >= ALL_WEBXML) {
- mapout.write(Localizer.getMessage("jspc.webxml.header"));
+ mapout.write(Localizer.getMessage("jspc.webxml.header",
webxmlEncoding));
mapout.flush();
} else if ((webxmlLevel>= INC_WEBXML) && !addWebXmlMappings) {
mapout.write(Localizer.getMessage("jspc.webinc.header"));
Modified: tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties?rev=1751702&r1=1751701&r2=1751702&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties
(original)
+++ tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties Wed
Jul 6 15:42:44 2016
@@ -176,7 +176,7 @@ where options include:\n\
\ -webinc <file> Creates a partial servlet mappings in the file\n\
\ -webxml <file> Creates a complete web.xml in the file\n\
\ -webxmlencoding <enc> Set the encoding charset used to read and write the
web.xml\n\
-\ file (default is platform default encoding)\n\
+\ file (default is UTF-8)\n\
\ -addwebxmlmappings Merge generated web.xml fragment into the web.xml file
of the\n\
\ web-app, whose JSP pages we are processing\n\
\ -ieplugin <clsid> Java Plugin classid for Internet Explorer\n\
@@ -187,7 +187,7 @@ where options include:\n\
\ -source <version> Set the -source argument to the compiler (default
1.8)\n\
\ -target <version> Set the -target argument to the compiler (default
1.8)\n\
-jspc.webxml.header=<?xml version="1.0" encoding="UTF-8"?>\n\
+jspc.webxml.header=<?xml version="1.0" encoding="{0}"?>\n\
\n\
<!DOCTYPE web-app\n\
\ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"\n\
Modified:
tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_es.properties
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_es.properties?rev=1751702&r1=1751701&r2=1751702&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_es.properties
(original)
+++ tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_es.properties
Wed Jul 6 15:42:44 2016
@@ -180,7 +180,7 @@ jspc.usage = Uso\: jspc <opciones> [--]
\ -javaEncoding <enc> Set the encoding charset for Java classes
(default UTF-8)\n\
\ -source <version> Set the -source argument to the compiler (default
1.8)\n\
\ -target <version> Set the -target argument to the compiler (default
1.8)\n
-jspc.webxml.header = <?xml version\="1.0" encoding\="UTF-8"?>\n\
+jspc.webxml.header = <?xml version\="1.0" encoding\="{0}"?>\n\
\n\
<\!DOCTYPE web-app\n\
\ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"\n\
Modified:
tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_fr.properties
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_fr.properties?rev=1751702&r1=1751701&r2=1751702&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_fr.properties
(original)
+++ tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_fr.properties
Wed Jul 6 15:42:44 2016
@@ -116,7 +116,7 @@ o\u00f9 les options comprennet:\n\
\ -source <version> Set the -source argument to the compiler (default
1.8)\n\
\ -target <version> Set the -target argument to the compiler (default
1.8)\n\
-jspc.webxml.header=<?xml version="1.0" encoding="UTF-8"?>\n\
+jspc.webxml.header=<?xml version="1.0" encoding="{0}"?>\n\
\n\
<!DOCTYPE web-app\n\
\ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"\n\
Modified:
tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_ja.properties
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_ja.properties?rev=1751702&r1=1751701&r2=1751702&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_ja.properties
(original)
+++ tomcat/trunk/java/org/apache/jasper/resources/LocalStrings_ja.properties
Wed Jul 6 15:42:44 2016
@@ -158,7 +158,7 @@ JSP\u30d5\u30a1\u30a4\u30eb\u306e\u5834\
\ -source <version> Set the -source argument to the compiler (default
1.8)\n\
\ -target <version> Set the -target argument to the compiler (default
1.8)\n\
-jspc.webxml.header=<?xml version="1.0" encoding="UTF-8"?>\n\
+jspc.webxml.header=<?xml version="1.0" encoding="{0}"?>\n\
\n\
<!DOCTYPE web-app\n\
\ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"\n\
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1751702&r1=1751701&r2=1751702&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jul 6 15:42:44 2016
@@ -45,6 +45,15 @@
issues do not "pop up" wrt. others).
-->
<section name="Tomcat 9.0.0.M10" rtext="in development">
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ When writing out a full web.xml file with JspC ensure that the encoding
+ used in the XML prolog matches the encoding used to write the contents
+ of the file. (markt)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="Tomcat 9.0.0.M9" rtext="release in progress">
<subsection name="Catalina">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]