mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish
This commit is contained in:
parent
0b9667c26f
commit
51092af739
@ -21,6 +21,7 @@ import javax.ws.rs.Path;
|
||||
|
||||
import org.apache.catalina.Context;
|
||||
import org.apache.catalina.Wrapper;
|
||||
import org.apache.tomcat.util.buf.UDecoder;
|
||||
import org.glassfish.jersey.server.ResourceConfig;
|
||||
import org.glassfish.jersey.servlet.ServletContainer;
|
||||
import org.junit.ClassRule;
|
||||
@ -104,7 +105,8 @@ public class JerseyAutoConfigurationServletContainerTests {
|
||||
jerseyServlet.setServlet(new ServletContainer());
|
||||
jerseyServlet.setOverridable(false);
|
||||
context.addChild(jerseyServlet);
|
||||
context.addServletMapping("/*", servletName);
|
||||
String pattern = UDecoder.URLDecode("/*", "UTF-8");
|
||||
context.addServletMappingDecoded(pattern, servletName);
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -254,7 +254,7 @@ public class TomcatEmbeddedServletContainerFactory
|
||||
// Otherwise the default location of a Spring DispatcherServlet cannot be set
|
||||
defaultServlet.setOverridable(true);
|
||||
context.addChild(defaultServlet);
|
||||
context.addServletMapping("/", "default");
|
||||
addServletMapping(context, "/", "default");
|
||||
}
|
||||
|
||||
private void addJspServlet(Context context) {
|
||||
@ -268,8 +268,13 @@ public class TomcatEmbeddedServletContainerFactory
|
||||
}
|
||||
jspServlet.setLoadOnStartup(3);
|
||||
context.addChild(jspServlet);
|
||||
context.addServletMapping("*.jsp", "jsp");
|
||||
context.addServletMapping("*.jspx", "jsp");
|
||||
addServletMapping(context, "*.jsp", "jsp");
|
||||
addServletMapping(context, "*.jspx", "jsp");
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void addServletMapping(Context context, String pattern, String name) {
|
||||
context.addServletMapping(pattern, name);
|
||||
}
|
||||
|
||||
private void addJasperInitializer(TomcatEmbeddedContext context) {
|
||||
|
Loading…
Reference in New Issue
Block a user