Polish SPR-12286

Issue: SPR-12286
This commit is contained in:
Brian Clozel
2014-10-22 21:15:34 +02:00
parent 2956049c30
commit a011b360d1
4 changed files with 13 additions and 13 deletions

View File

@@ -162,6 +162,9 @@ public class ContentNegotiationConfigurer {
* <p>This content type will be used when neither the request path extension,
* nor a request parameter, nor the {@code Accept} header could help determine
* the requested content type.
* <p>Note that this method achieves the same goal as {@code defaultContentTypeStrategy}, so both
* shouldn't be used at the same time.
* @see #defaultContentTypeStrategy(org.springframework.web.accept.ContentNegotiationStrategy)
*/
public ContentNegotiationConfigurer defaultContentType(MediaType defaultContentType) {
this.factoryBean.setDefaultContentType(defaultContentType);
@@ -173,10 +176,13 @@ public class ContentNegotiationConfigurer {
* <p>This content type will be used when neither the request path extension,
* nor a request parameter, nor the {@code Accept} header could help determine
* the requested content type.
* <p>Note that this method achieves the same goal as {@code defaultContentType}, so both
* shouldn't be used at the same time.
* @since 4.1.2
* @see #defaultContentType(org.springframework.http.MediaType)
*/
public ContentNegotiationConfigurer defaultContentType(ContentNegotiationStrategy defaultStrategy) {
this.factoryBean.setDefaultContentType(defaultStrategy);
public ContentNegotiationConfigurer defaultContentTypeStrategy(ContentNegotiationStrategy defaultStrategy) {
this.factoryBean.setDefaultContentTypeStrategy(defaultStrategy);
return this;
}