Introduce "server.servlet" configuration prefix
This commit refactors the `ServerProperties` property keys and introduces a separate "server.servlet" namespace to isolate servlet-specific properties from the rest. Closes gh-8066
This commit is contained in:
@@ -95,8 +95,8 @@ public class RemoteDevToolsAutoConfiguration {
|
||||
@Bean
|
||||
public HandlerMapper remoteDevToolsHealthCheckHandlerMapper() {
|
||||
Handler handler = new HttpStatusHandler();
|
||||
return new UrlHandlerMapper((this.serverProperties.getContextPath() == null ? ""
|
||||
: this.serverProperties.getContextPath())
|
||||
return new UrlHandlerMapper((this.serverProperties.getServlet().getContextPath() == null ? ""
|
||||
: this.serverProperties.getServlet().getContextPath())
|
||||
+ this.properties.getRemote().getContextPath(), handler);
|
||||
}
|
||||
|
||||
@@ -136,8 +136,8 @@ public class RemoteDevToolsAutoConfiguration {
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(name = "remoteRestartHandlerMapper")
|
||||
public UrlHandlerMapper remoteRestartHandlerMapper(HttpRestartServer server) {
|
||||
String url = (this.serverProperties.getContextPath() == null ? ""
|
||||
: this.serverProperties.getContextPath())
|
||||
String url = (this.serverProperties.getServlet().getContextPath() == null ? ""
|
||||
: this.serverProperties.getServlet().getContextPath())
|
||||
+ this.properties.getRemote().getContextPath() + "/restart";
|
||||
logger.warn("Listening for remote restart updates on " + url);
|
||||
Handler handler = new HttpRestartServerHandler(server);
|
||||
@@ -162,8 +162,8 @@ public class RemoteDevToolsAutoConfiguration {
|
||||
@ConditionalOnMissingBean(name = "remoteDebugHandlerMapper")
|
||||
public UrlHandlerMapper remoteDebugHandlerMapper(
|
||||
@Qualifier("remoteDebugHttpTunnelServer") HttpTunnelServer server) {
|
||||
String url = (this.serverProperties.getContextPath() == null ? ""
|
||||
: this.serverProperties.getContextPath())
|
||||
String url = (this.serverProperties.getServlet().getContextPath() == null ? ""
|
||||
: this.serverProperties.getServlet().getContextPath())
|
||||
+ this.properties.getRemote().getContextPath() + "/debug";
|
||||
logger.warn("Listening for remote debug traffic on " + url);
|
||||
Handler handler = new HttpTunnelServerHandler(server);
|
||||
|
||||
@@ -56,7 +56,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
|
||||
properties.put("spring.resources.chain.cache", "false");
|
||||
properties.put("spring.template.provider.cache", "false");
|
||||
properties.put("spring.mvc.log-resolved-exception", "true");
|
||||
properties.put("server.jsp-servlet.init-parameters.development", "true");
|
||||
properties.put("server.servlet.jsp.init-parameters.development", "true");
|
||||
properties.put("spring.reactor.stacktrace-mode.enabled", "true");
|
||||
PROPERTIES = Collections.unmodifiableMap(properties);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public class RemoteDevToolsAutoConfigurationTests {
|
||||
@Test
|
||||
public void invokeRestartWithCustomServerContextPath() throws Exception {
|
||||
loadContext("spring.devtools.remote.secret:supersecret",
|
||||
"server.context-path:/test");
|
||||
"server.servlet.context-path:/test");
|
||||
DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
|
||||
this.request.setRequestURI("/test" + DEFAULT_CONTEXT_PATH + "/restart");
|
||||
this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
|
||||
@@ -167,7 +167,7 @@ public class RemoteDevToolsAutoConfigurationTests {
|
||||
@Test
|
||||
public void invokeTunnelWithCustomServerContextPath() throws Exception {
|
||||
loadContext("spring.devtools.remote.secret:supersecret",
|
||||
"server.context-path:/test");
|
||||
"server.servlet.context-path:/test");
|
||||
DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
|
||||
this.request.setRequestURI("/test" + DEFAULT_CONTEXT_PATH + "/debug");
|
||||
this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
|
||||
@@ -208,7 +208,7 @@ public class RemoteDevToolsAutoConfigurationTests {
|
||||
@Test
|
||||
public void devToolsHealthWithCustomServerContextPathReturns200() throws Exception {
|
||||
loadContext("spring.devtools.remote.secret:supersecret",
|
||||
"server.context-path:/test");
|
||||
"server.servlet.context-path:/test");
|
||||
DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
|
||||
this.request.setRequestURI("/test" + DEFAULT_CONTEXT_PATH);
|
||||
this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
|
||||
|
||||
Reference in New Issue
Block a user