|
18 | 18 |
|
19 | 19 | import java.time.Duration;
|
20 | 20 | import java.util.List;
|
21 |
| -import java.util.ListIterator; |
22 | 21 | import java.util.Map;
|
23 | 22 | import java.util.function.Consumer;
|
24 | 23 |
|
|
80 | 79 | import org.springframework.validation.DefaultMessageCodesResolver;
|
81 | 80 | import org.springframework.validation.MessageCodesResolver;
|
82 | 81 | import org.springframework.validation.Validator;
|
83 |
| -import org.springframework.web.HttpMediaTypeNotAcceptableException; |
84 | 82 | import org.springframework.web.accept.ContentNegotiationManager;
|
85 |
| -import org.springframework.web.accept.ContentNegotiationStrategy; |
86 | 83 | import org.springframework.web.bind.support.ConfigurableWebBindingInitializer;
|
87 | 84 | import org.springframework.web.context.ServletContextAware;
|
88 |
| -import org.springframework.web.context.request.NativeWebRequest; |
89 |
| -import org.springframework.web.context.request.RequestAttributes; |
90 | 85 | import org.springframework.web.context.request.RequestContextListener;
|
91 | 86 | import org.springframework.web.context.support.ServletContextResource;
|
92 | 87 | import org.springframework.web.filter.FormContentFilter;
|
@@ -459,15 +454,6 @@ public LocaleResolver localeResolver() {
|
459 | 454 | return localeResolver;
|
460 | 455 | }
|
461 | 456 |
|
462 |
| - @Override |
463 |
| - @Bean |
464 |
| - @ConditionalOnMissingBean(name = DispatcherServlet.THEME_RESOLVER_BEAN_NAME) |
465 |
| - @Deprecated(since = "3.0.0", forRemoval = false) |
466 |
| - @SuppressWarnings("deprecation") |
467 |
| - public org.springframework.web.servlet.ThemeResolver themeResolver() { |
468 |
| - return super.themeResolver(); |
469 |
| - } |
470 |
| - |
471 | 457 | @Override
|
472 | 458 | @Bean
|
473 | 459 | @ConditionalOnMissingBean(name = DispatcherServlet.FLASH_MAP_MANAGER_BEAN_NAME)
|
@@ -580,22 +566,6 @@ protected void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> ex
|
580 | 566 | }
|
581 | 567 | }
|
582 | 568 |
|
583 |
| - @Bean |
584 |
| - @Override |
585 |
| - @SuppressWarnings("deprecation") |
586 |
| - public ContentNegotiationManager mvcContentNegotiationManager() { |
587 |
| - ContentNegotiationManager manager = super.mvcContentNegotiationManager(); |
588 |
| - List<ContentNegotiationStrategy> strategies = manager.getStrategies(); |
589 |
| - ListIterator<ContentNegotiationStrategy> iterator = strategies.listIterator(); |
590 |
| - while (iterator.hasNext()) { |
591 |
| - ContentNegotiationStrategy strategy = iterator.next(); |
592 |
| - if (strategy instanceof org.springframework.web.accept.PathExtensionContentNegotiationStrategy) { |
593 |
| - iterator.set(new OptionalPathExtensionContentNegotiationStrategy(strategy)); |
594 |
| - } |
595 |
| - } |
596 |
| - return manager; |
597 |
| - } |
598 |
| - |
599 | 569 | @Override
|
600 | 570 | public void setResourceLoader(ResourceLoader resourceLoader) {
|
601 | 571 | this.resourceLoader = resourceLoader;
|
@@ -683,33 +653,4 @@ ProblemDetailsExceptionHandler problemDetailsExceptionHandler() {
|
683 | 653 |
|
684 | 654 | }
|
685 | 655 |
|
686 |
| - /** |
687 |
| - * Decorator to make |
688 |
| - * {@link org.springframework.web.accept.PathExtensionContentNegotiationStrategy} |
689 |
| - * optional depending on a request attribute. |
690 |
| - */ |
691 |
| - static class OptionalPathExtensionContentNegotiationStrategy implements ContentNegotiationStrategy { |
692 |
| - |
693 |
| - @SuppressWarnings("deprecation") |
694 |
| - private static final String SKIP_ATTRIBUTE = org.springframework.web.accept.PathExtensionContentNegotiationStrategy.class |
695 |
| - .getName() + ".SKIP"; |
696 |
| - |
697 |
| - private final ContentNegotiationStrategy delegate; |
698 |
| - |
699 |
| - OptionalPathExtensionContentNegotiationStrategy(ContentNegotiationStrategy delegate) { |
700 |
| - this.delegate = delegate; |
701 |
| - } |
702 |
| - |
703 |
| - @Override |
704 |
| - public List<MediaType> resolveMediaTypes(NativeWebRequest webRequest) |
705 |
| - throws HttpMediaTypeNotAcceptableException { |
706 |
| - Object skip = webRequest.getAttribute(SKIP_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST); |
707 |
| - if (skip != null && Boolean.parseBoolean(skip.toString())) { |
708 |
| - return MEDIA_TYPE_ALL_LIST; |
709 |
| - } |
710 |
| - return this.delegate.resolveMediaTypes(webRequest); |
711 |
| - } |
712 |
| - |
713 |
| - } |
714 |
| - |
715 | 656 | }
|
0 commit comments