Remove - from path-match and content-negotiation properties

Closes gh-11913
This commit is contained in:
Andy Wilkinson
2018-02-07 15:05:15 +00:00
parent 83f65a38b1
commit 9a456924e4
6 changed files with 36 additions and 36 deletions

View File

@@ -218,21 +218,21 @@ public class WebMvcAutoConfiguration {
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(
this.mvcProperties.getPathMatch().isUseSuffixPattern());
this.mvcProperties.getPathmatch().isUseSuffixPattern());
configurer.setUseRegisteredSuffixPatternMatch(
this.mvcProperties.getPathMatch().isUseRegisteredSuffixPattern());
this.mvcProperties.getPathmatch().isUseRegisteredSuffixPattern());
}
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
WebMvcProperties.ContentNegotiation contentNegotiation = this.mvcProperties
.getContentNegotiation();
configurer.favorPathExtension(contentNegotiation.isFavorPathExtension());
configurer.favorParameter(contentNegotiation.isFavorParameter());
if (contentNegotiation.getParameterName() != null) {
configurer.parameterName(contentNegotiation.getParameterName());
WebMvcProperties.Contentnegotiation contentnegotiation = this.mvcProperties
.getContentnegotiation();
configurer.favorPathExtension(contentnegotiation.isFavorPathExtension());
configurer.favorParameter(contentnegotiation.isFavorParameter());
if (contentnegotiation.getParameterName() != null) {
configurer.parameterName(contentnegotiation.getParameterName());
}
Map<String, MediaType> mediaTypes = this.mvcProperties.getContentNegotiation()
Map<String, MediaType> mediaTypes = this.mvcProperties.getContentnegotiation()
.getMediaTypes();
for (Entry<String, MediaType> mediaType : mediaTypes.entrySet()) {
configurer.mediaType(mediaType.getKey(), mediaType.getValue());

View File

@@ -98,9 +98,9 @@ public class WebMvcProperties {
private final View view = new View();
private final ContentNegotiation contentNegotiation = new ContentNegotiation();
private final Contentnegotiation contentnegotiation = new Contentnegotiation();
private final PathMatch pathMatch = new PathMatch();
private final Pathmatch pathmatch = new Pathmatch();
public DefaultMessageCodesResolver.Format getMessageCodesResolverFormat() {
return this.messageCodesResolverFormat;
@@ -196,12 +196,12 @@ public class WebMvcProperties {
return this.view;
}
public ContentNegotiation getContentNegotiation() {
return this.contentNegotiation;
public Contentnegotiation getContentnegotiation() {
return this.contentnegotiation;
}
public PathMatch getPathMatch() {
return this.pathMatch;
public Pathmatch getPathmatch() {
return this.pathmatch;
}
public static class Async {
@@ -270,7 +270,7 @@ public class WebMvcProperties {
}
public static class ContentNegotiation {
public static class Contentnegotiation {
/**
* Whether the path extension in the URL path should be used to determine the
@@ -330,7 +330,7 @@ public class WebMvcProperties {
}
public static class PathMatch {
public static class Pathmatch {
/**
* Whether to use suffix pattern match (".*") when matching patterns to requests.

View File

@@ -414,7 +414,7 @@
"type" : "java.util.Map<java.lang.String,org.springframework.http.MediaType>",
"description" : "Maps file extensions to media types for content negotiation, e.g. yml to text/yaml.",
"deprecation" : {
"replacement" : "spring.mvc.content-negotiation.media-types",
"replacement" : "spring.mvc.contentnegotiation.media-types",
"level" : "error"
}
},

View File

@@ -473,8 +473,8 @@ public class WebMvcAutoConfigurationTests {
public void customMediaTypes() {
this.contextRunner
.withPropertyValues(
"spring.mvc.content-negotiation.media-types.yaml:text/yaml",
"spring.mvc.content-negotiation.favor-path-extension:true")
"spring.mvc.contentnegotiation.media-types.yaml:text/yaml",
"spring.mvc.contentnegotiation.favor-path-extension:true")
.run((context) -> {
RequestMappingHandlerAdapter adapter = context
.getBean(RequestMappingHandlerAdapter.class);
@@ -755,8 +755,8 @@ public class WebMvcAutoConfigurationTests {
@Test
public void useSuffixPatternMatch() {
this.contextRunner
.withPropertyValues("spring.mvc.path-match.use-suffix-pattern:true",
"spring.mvc.path-match.use-registered-suffix-pattern:true")
.withPropertyValues("spring.mvc.pathmatch.use-suffix-pattern:true",
"spring.mvc.pathmatch.use-registered-suffix-pattern:true")
.run((context) -> {
RequestMappingHandlerMapping handlerMapping = context
.getBean(RequestMappingHandlerMapping.class);
@@ -782,7 +782,7 @@ public class WebMvcAutoConfigurationTests {
public void pathExtensionContentNegotiation() {
this.contextRunner
.withPropertyValues(
"spring.mvc.content-negotiation.favor-path-extension:true")
"spring.mvc.contentnegotiation.favor-path-extension:true")
.run((context) -> {
RequestMappingHandlerMapping handlerMapping = context
.getBean(RequestMappingHandlerMapping.class);
@@ -797,7 +797,7 @@ public class WebMvcAutoConfigurationTests {
@Test
public void queryParameterContentNegotiation() {
this.contextRunner
.withPropertyValues("spring.mvc.content-negotiation.favor-parameter:true")
.withPropertyValues("spring.mvc.contentnegotiation.favor-parameter:true")
.run((context) -> {
RequestMappingHandlerMapping handlerMapping = context
.getBean(RequestMappingHandlerMapping.class);