Introduce an extra `server.tomcat.uri-encoding` property used to
configure the URI encoding for the embedded tomcat container.
Defaults to `UTF-8` instead of the usual tomcat default of `ISO-8859-1`.
Fixes gh-540
pull/575/head
Stephane Nicoll12 years agocommitted byPhillip Webb
@ -144,6 +145,8 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
@@ -144,6 +145,8 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
privateintmaxThreads=0;// Number of threads in protocol handler
privateStringuriEncoding;
publicintgetMaxThreads(){
returnthis.maxThreads;
}
@ -200,6 +203,14 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
@@ -200,6 +203,14 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
@ -247,6 +258,9 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
@@ -247,6 +258,9 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
@ -93,6 +94,8 @@ public class TomcatEmbeddedServletContainerFactory extends
@@ -93,6 +94,8 @@ public class TomcatEmbeddedServletContainerFactory extends
@ -206,6 +209,10 @@ public class TomcatEmbeddedServletContainerFactory extends
@@ -206,6 +209,10 @@ public class TomcatEmbeddedServletContainerFactory extends
.setAddress(getAddress());
}
}
if(getUriEncoding()!=null){
connector.setURIEncoding(getUriEncoding());
}
// If ApplicationContext is slow to start we want Tomcat not to bind to the socket
// prematurely...
connector.setProperty("bindOnInit","false");
@ -455,10 +462,28 @@ public class TomcatEmbeddedServletContainerFactory extends
@@ -455,10 +462,28 @@ public class TomcatEmbeddedServletContainerFactory extends
@ -190,11 +191,30 @@ public class TomcatEmbeddedServletContainerFactoryTests extends
@@ -190,11 +191,30 @@ public class TomcatEmbeddedServletContainerFactoryTests extends