429616 Use UTF-8 encoding for XML

This commit is contained in:
Greg Wilkins 2014-03-10 15:23:08 +11:00
parent eacdaf7073
commit 84fa579ec7
59 changed files with 90 additions and 86 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-fragment
xmlns="http://xmlns.jcp.org/xml/ns/javaee"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!--

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- This file contains the default descriptor for web applications. -->

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/foo</Set>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!-- Simple handler to redirect from old path to new -->

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!--
Copyright (c) 2009-2011 Intalio, Inc.

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.server.handler.ContextHandler">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- This file contains the default descriptor for web applications. -->

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.server.handler.ContextHandler">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.overlays.TemplateContext">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- This file contains the default descriptor for web applications. -->

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.eclipse.org/configure.dtd">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-fragment
xmlns="http://java.sun.com/xml/ns/javaee"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-fragment
xmlns="http://java.sun.com/xml/ns/javaee"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-fragment
xmlns="http://java.sun.com/xml/ns/javaee"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -30,7 +30,6 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpFields;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpHeaderValue;
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.http.MimeTypes;
@ -140,7 +139,7 @@ public class ErrorHandler extends AbstractHandler
protected void writeErrorPageHead(HttpServletRequest request, Writer writer, int code, String message)
throws IOException
{
writer.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\"/>\n");
writer.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n");
writer.write("<title>Error ");
writer.write(Integer.toString(code));
@ -213,7 +212,7 @@ public class ErrorHandler extends AbstractHandler
if (reason==null)
reason=HttpStatus.getMessage(status);
fields.put(HttpHeader.CONTENT_TYPE,MimeTypes.Type.TEXT_HTML_8859_1.asString());
return BufferUtil.toBuffer("<h1>Bad Message "+status+"</h1><pre>reason: "+reason+"</pre>");
return BufferUtil.toBuffer("<h1>Bad Message " + status + "</h1><pre>reason: " + reason + "</pre>");
}
/* ------------------------------------------------------------ */

View File

@ -26,6 +26,7 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@ -155,7 +156,7 @@ public abstract class ConnectorCloseTestBase extends HttpServerTestFixture
"content-type: text/plain; charset=utf-8\r\n"+
"content-length: "+bytes.length+"\r\n"+
"\r\n"
).getBytes("iso-8859-1"));
).getBytes(StandardCharsets.ISO_8859_1));
int len = bytes.length;
int offset = 0;

View File

@ -58,13 +58,14 @@ import org.eclipse.jetty.util.log.StdErrLog;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Test;
/**
*
*/
public abstract class HttpServerTestBase extends HttpServerTestFixture
{
private static final String REQUEST1_HEADER = "POST / HTTP/1.0\n" + "Host: localhost\n" + "Content-Type: text/xml; charset=utf-8\n" + "Connection: close\n" + "Content-Length: ";
private static final String REQUEST1_CONTENT = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
private static final String REQUEST1_CONTENT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<nimbus xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + " xsi:noNamespaceSchemaLocation=\"nimbus.xsd\" version=\"1.0\">\n"
+ "</nimbus>";
private static final String REQUEST1 = REQUEST1_HEADER + REQUEST1_CONTENT.getBytes().length + "\n\n" + REQUEST1_CONTENT;
@ -82,7 +83,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
"Content-Type: text/xml; charset=ISO-8859-1\n" +
"Content-Length: ";
protected static final String REQUEST2_CONTENT =
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" +
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<nimbus xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xsi:noNamespaceSchemaLocation=\"nimbus.xsd\" version=\"1.0\">\n" +
" <request requestId=\"1\">\n" +
@ -94,7 +95,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
protected static final String REQUEST2 = REQUEST2_HEADER + REQUEST2_CONTENT.getBytes().length + "\n\n" + REQUEST2_CONTENT;
protected static final String RESPONSE2_CONTENT =
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" +
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<nimbus xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xsi:noNamespaceSchemaLocation=\"nimbus.xsd\" version=\"1.0\">\n" +
" <request requestId=\"1\">\n" +
@ -144,7 +145,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
{
client.setSoTimeout(10000);
((StdErrLog)Log.getLogger(HttpConnection.class)).setHideStacks(true);
((StdErrLog)Log.getLogger(HttpConnection.class)).info("expect request is too large, then ISE extra data ...");
((StdErrLog) Log.getLogger(HttpConnection.class)).info("expect request is too large, then ISE extra data ...");
OutputStream os = client.getOutputStream();
byte[] buffer = new byte[64 * 1024];
@ -926,7 +927,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
"host: " + _serverURI.getHost() + ":" + _serverURI.getPort() + "\r\n" +
"content-type: text/plain; charset=utf-8\r\n" +
"content-length: 10\r\n" +
"\r\n").getBytes("iso-8859-1"));
"\r\n").getBytes(StandardCharsets.ISO_8859_1));
os.write((
"123456789\n"
@ -938,7 +939,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
"content-type: text/plain; charset=utf-8\r\n" +
"content-length: 10\r\n" +
"\r\n"
).getBytes("iso-8859-1"));
).getBytes(StandardCharsets.ISO_8859_1));
os.write((
"abcdefghZ\n"
@ -953,7 +954,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
"content-length: " + contentB.length + "\r\n" +
"connection: close\r\n" +
"\r\n"
).getBytes("iso-8859-1"));
).getBytes(StandardCharsets.ISO_8859_1));
os.write(contentB);
os.flush();
@ -1028,7 +1029,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
"\015\012" +
"abcdefghi\n"
).getBytes("iso-8859-1"));
).getBytes(StandardCharsets.ISO_8859_1));
String in = IO.toString(is);
@ -1053,7 +1054,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
"host: " + _serverURI.getHost() + ":" + _serverURI.getPort() + "\r\n" +
"content-type: text/plain; charset=utf-8\r\n" +
"content-length: 10\r\n" +
"\r\n").getBytes("iso-8859-1"));
"\r\n").getBytes(StandardCharsets.ISO_8859_1));
os.write((
"123456789\n"
@ -1065,14 +1066,14 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
"content-type: text/plain; charset=utf-8\r\n" +
"content-length: 10\r\n" +
"\r\n"
).getBytes("iso-8859-1"));
).getBytes(StandardCharsets.ISO_8859_1));
os.write((
"abcdefghi\n"
).getBytes("utf-8"));
).getBytes(StandardCharsets.UTF_8));
String content = "Wibble";
byte[] contentB = content.getBytes("utf-16");
byte[] contentB = content.getBytes(StandardCharsets.UTF_16);
os.write((
"POST /echo?charset=utf-8 HTTP/1.1\r\n" +
"host: " + _serverURI.getHost() + ":" + _serverURI.getPort() + "\r\n" +
@ -1080,7 +1081,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
"content-length: " + contentB.length + "\r\n" +
"connection: close\r\n" +
"\r\n"
).getBytes("iso-8859-1"));
).getBytes(StandardCharsets.ISO_8859_1));
os.write(contentB);
os.flush();

View File

@ -31,6 +31,7 @@ import javax.net.ssl.SSLSession;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.server.handler.HandlerWrapper;
@ -42,7 +43,7 @@ import org.junit.Before;
public class HttpServerTestFixture
{ // Useful constants
protected static final long PAUSE=10L;
protected static final int LOOPS=PropertyFlag.isEnabled("test.stress")?250:50;
protected static final int LOOPS= PropertyFlag.isEnabled("test.stress")?250:50;
protected Server _server;
protected URI _serverURI;
@ -168,7 +169,7 @@ public class HttpServerTestFixture
response.setStatus(200);
InputStream in = request.getInputStream();
String input=IO.toString(in);
String input= IO.toString(in);
String tmp = request.getParameter("writes");
int writes=Integer.parseInt(tmp==null?"10":tmp);
@ -185,7 +186,7 @@ public class HttpServerTestFixture
response.setContentType("text/plain");
if (encoding==null)
{
byte[] bytes=chunk.getBytes("ISO-8859-1");
byte[] bytes=chunk.getBytes(StandardCharsets.ISO_8859_1);
OutputStream out=response.getOutputStream();
for (int i=0;i<writes;i++)
{

View File

@ -69,14 +69,14 @@ public class SSLEngineTest
{
// Useful constants
private static final String HELLO_WORLD="Hello world. The quick brown fox jumped over the lazy dog. How now brown cow. The rain in spain falls mainly on the plain.\n";
private static final String JETTY_VERSION=Server.getVersion();
private static final String JETTY_VERSION= Server.getVersion();
private static final String PROTOCOL_VERSION="2.0";
/** The request. */
private static final String REQUEST0_HEADER="POST /r0 HTTP/1.1\n"+"Host: localhost\n"+"Content-Type: text/xml\n"+"Content-Length: ";
private static final String REQUEST1_HEADER="POST /r1 HTTP/1.1\n"+"Host: localhost\n"+"Content-Type: text/xml\n"+"Connection: close\n"+"Content-Length: ";
private static final String REQUEST_CONTENT=
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"+
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+
"<requests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"+
" xsi:noNamespaceSchemaLocation=\"commander.xsd\" version=\""+PROTOCOL_VERSION+"\">\n"+
"</requests>";
@ -145,7 +145,7 @@ public class SSLEngineTest
String response = IO.toString(client.getInputStream());
assertThat(response,Matchers.containsString("200 OK"));
assertThat(response, Matchers.containsString("200 OK"));
assertThat(response,Matchers.containsString(HELLO_WORLD));
}

View File

@ -23,6 +23,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -172,7 +173,7 @@ public class AsyncServletIOTest
{
socket.setSoTimeout(1000000);
OutputStream out = socket.getOutputStream();
out.write(request.toString().getBytes("ISO-8859-1"));
out.write(request.toString().getBytes(StandardCharsets.ISO_8859_1));
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()),102400);
@ -207,7 +208,7 @@ public class AsyncServletIOTest
public synchronized List<String> process(String content,int... writes) throws Exception
{
return process(content.getBytes("ISO-8859-1"),writes);
return process(content.getBytes(StandardCharsets.ISO_8859_1),writes);
}
public synchronized List<String> process(int... writes) throws Exception
@ -242,7 +243,7 @@ public class AsyncServletIOTest
{
socket.setSoTimeout(1000000);
OutputStream out = socket.getOutputStream();
out.write(request.toString().getBytes("ISO-8859-1"));
out.write(request.toString().getBytes(StandardCharsets.ISO_8859_1));
if (content!=null && content.length>0)
{

View File

@ -99,7 +99,7 @@ public class AsyncServletTest
public void tearDown() throws Exception
{
assertEquals(_expectedLogs,_log.size());
Assert.assertThat(_log.get(0),Matchers.containsString(_expectedCode));
Assert.assertThat(_log.get(0), Matchers.containsString(_expectedCode));
_server.stop();
}
@ -379,12 +379,12 @@ public class AsyncServletTest
try (Socket socket = new Socket("localhost",_port))
{
socket.setSoTimeout(10000);
socket.getOutputStream().write(header.getBytes("ISO-8859-1"));
socket.getOutputStream().write(header.getBytes(StandardCharsets.ISO_8859_1));
Thread.sleep(500);
socket.getOutputStream().write(body.getBytes("ISO-8859-1"),0,2);
socket.getOutputStream().write(body.getBytes(StandardCharsets.ISO_8859_1),0,2);
Thread.sleep(500);
socket.getOutputStream().write(body.getBytes("ISO-8859-1"),2,8);
socket.getOutputStream().write(close.getBytes("ISO-8859-1"));
socket.getOutputStream().write(body.getBytes(StandardCharsets.ISO_8859_1),2,8);
socket.getOutputStream().write(close.getBytes(StandardCharsets.ISO_8859_1));
String response = IO.toString(socket.getInputStream());
assertEquals("HTTP/1.1 200 OK",response.substring(0,15));
@ -434,7 +434,7 @@ public class AsyncServletTest
protected void assertContains(String content,String response)
{
Assert.assertThat(response,Matchers.containsString(content));
Assert.assertThat(response, Matchers.containsString(content));
}
protected void assertNotContains(String content,String response)

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -40,7 +40,7 @@ public class XmlAppendable
{
_out=out;
_indent=indent;
_out.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n");
_out.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
}
public XmlAppendable open(String tag, Map<String,String> attributes) throws IOException

View File

@ -95,7 +95,7 @@ public class XmlConfiguration
private synchronized static XmlParser initParser()
{
XmlParser parser = new XmlParser();
URL config60 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_6_0.dtd");
URL config60 = Loader.getResource(XmlConfiguration.class, "org/eclipse/jetty/xml/configure_6_0.dtd");
URL config76 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_7_6.dtd");
URL config90 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_9_0.dtd");
parser.redirectEntity("configure.dtd",config90);
@ -150,7 +150,7 @@ public class XmlConfiguration
*/
public XmlConfiguration(String configuration) throws SAXException, IOException
{
configuration = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<!DOCTYPE Configure PUBLIC \"-//Jetty//Configure//EN\" \"http://eclipse.org/jetty/configure.dtd\">"
configuration = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE Configure PUBLIC \"-//Jetty//Configure//EN\" \"http://eclipse.org/jetty/configure.dtd\">"
+ configuration;
InputSource source = new InputSource(new StringReader(configuration));
synchronized (__parser)

View File

@ -49,6 +49,6 @@ public class XmlAppendableTest
out.close();
String s = b.toString();
Assert.assertEquals("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<test>\n <tag/>\n <tag quotes=\"&apos;&quot;\" name=\"attr value\" noval=\"\"/>\n <tag quotes=\"&apos;&quot;\" name=\"attr value\" noval=\"\">content</tag>\n <level1>\n <tag>content</tag>\n <tag>content</tag>\n </level1>\n <level1 quotes=\"&apos;&quot;\" name=\"attr value\" noval=\"\">\n <level2>\n <tag>content</tag>\n <tag>content</tag>\n </level2>\n </level1>\n</test>\n",s);
Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<test>\n <tag/>\n <tag quotes=\"&apos;&quot;\" name=\"attr value\" noval=\"\"/>\n <tag quotes=\"&apos;&quot;\" name=\"attr value\" noval=\"\">content</tag>\n <level1>\n <tag>content</tag>\n <tag>content</tag>\n </level1>\n <level1 quotes=\"&apos;&quot;\" name=\"attr value\" noval=\"\">\n <level2>\n <tag>content</tag>\n <tag>content</tag>\n </level2>\n </level1>\n</test>\n",s);
}
}

View File

@ -27,6 +27,7 @@ import static org.junit.Assert.assertTrue;
import java.io.ByteArrayInputStream;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
@ -578,7 +579,7 @@ public class XmlConfigurationTest
" <Arg>arg3</Arg>\n" +
" </New>" +
" </Set>" +
"</Configure>").getBytes("ISO-8859-1")));
"</Configure>").getBytes(StandardCharsets.ISO_8859_1)));
// XmlConfiguration xmlConfiguration = new XmlConfiguration(url);
AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure();
@ -606,7 +607,7 @@ public class XmlConfigurationTest
" <Set name=\"third\">arg3</Set> " +
" </New>" +
" </Set>" +
"</Configure>").getBytes("ISO-8859-1")));
"</Configure>").getBytes(StandardCharsets.UTF_8)));
// XmlConfiguration xmlConfiguration = new XmlConfiguration(url);
DefaultTestConfiguration atc = (DefaultTestConfiguration)xmlConfiguration.configure();

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.xml.TestConfiguration">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="java.lang.Object">
</Configure>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/rfc2616-webapp</Set>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- This file contains the default descriptor for web applications. -->

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!-- ==================================================================

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!-- ==================================================================

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!--

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-fragment
xmlns="http://xmlns.jcp.org/xml/ns/javaee"