@@ -284,12 +284,10 @@ public RequestMappingHandlerMapping requestMappingHandlerMapping() {
284
284
if (useSuffixPatternMatch != null ) {
285
285
mapping .setUseSuffixPatternMatch (useSuffixPatternMatch );
286
286
}
287
-
288
287
Boolean useRegisteredSuffixPatternMatch = configurer .isUseRegisteredSuffixPatternMatch ();
289
288
if (useRegisteredSuffixPatternMatch != null ) {
290
289
mapping .setUseRegisteredSuffixPatternMatch (useRegisteredSuffixPatternMatch );
291
290
}
292
-
293
291
Boolean useTrailingSlashMatch = configurer .isUseTrailingSlashMatch ();
294
292
if (useTrailingSlashMatch != null ) {
295
293
mapping .setUseTrailingSlashMatch (useTrailingSlashMatch );
@@ -299,12 +297,10 @@ public RequestMappingHandlerMapping requestMappingHandlerMapping() {
299
297
if (pathHelper != null ) {
300
298
mapping .setUrlPathHelper (pathHelper );
301
299
}
302
-
303
300
PathMatcher pathMatcher = configurer .getPathMatcher ();
304
301
if (pathMatcher != null ) {
305
302
mapping .setPathMatcher (pathMatcher );
306
303
}
307
-
308
304
Map <String , Predicate <Class <?>>> pathPrefixes = configurer .getPathPrefixes ();
309
305
if (pathPrefixes != null ) {
310
306
mapping .setPathPrefixes (pathPrefixes );
@@ -324,8 +320,8 @@ protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
324
320
325
321
/**
326
322
* Provide access to the shared handler interceptors used to configure
327
- * {@link HandlerMapping} instances with. This method cannot be overridden,
328
- * use {@link #addInterceptors(InterceptorRegistry) } instead.
323
+ * {@link HandlerMapping} instances with.
324
+ * <p>This method cannot be overridden; use {@link #addInterceptors} instead.
329
325
*/
330
326
protected final Object [] getInterceptors () {
331
327
if (this .interceptors == null ) {
@@ -628,9 +624,8 @@ protected void configureAsyncSupport(AsyncSupportConfigurer configurer) {
628
624
}
629
625
630
626
/**
631
- * Return a {@link FormattingConversionService} for use with annotated
632
- * controller methods and the {@code spring:eval} JSP tag.
633
- * Also see {@link #addFormatters} as an alternative to overriding this method.
627
+ * Return a {@link FormattingConversionService} for use with annotated controllers.
628
+ * <p>See {@link #addFormatters} as an alternative to overriding this method.
634
629
*/
635
630
@ Bean
636
631
public FormattingConversionService mvcConversionService () {
@@ -640,8 +635,9 @@ public FormattingConversionService mvcConversionService() {
640
635
}
641
636
642
637
/**
643
- * Override this method to add custom {@link Converter}s and
644
- * {@link Formatter Converter}s and {@link Formatters}.
638
+ * Override this method to add custom {@link Converter} and/or {@link Formatter}
639
+ * delegates to the common {@link FormattingConversionService}.
640
+ * @see #mvcConversionService()
645
641
*/
646
642
protected void addFormatters (FormatterRegistry registry ) {
647
643
}
@@ -686,9 +682,8 @@ protected Validator getValidator() {
686
682
687
683
/**
688
684
* Provide access to the shared custom argument resolvers used by the
689
- * {@link RequestMappingHandlerAdapter} and the
690
- * {@link ExceptionHandlerExceptionResolver}. This method cannot be
691
- * overridden, use {@link #addArgumentResolvers(List)} instead.
685
+ * {@link RequestMappingHandlerAdapter} and the {@link ExceptionHandlerExceptionResolver}.
686
+ * <p>This method cannot be overridden; use {@link #addArgumentResolvers} instead.
692
687
* @since 4.3
693
688
*/
694
689
protected final List <HandlerMethodArgumentResolver > getArgumentResolvers () {
@@ -700,24 +695,21 @@ protected final List<HandlerMethodArgumentResolver> getArgumentResolvers() {
700
695
}
701
696
702
697
/**
703
- * Add custom {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers} to use in addition to
704
- * the ones registered by default.
705
- * <p>Custom argument resolvers are invoked before built-in resolvers
706
- * except for those that rely on the presence of annotations (e.g.
707
- * {@code @RequestParameter}, {@code @PathVariable}, etc.).
708
- * The latter can be customized by configuring the
698
+ * Add custom {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers}
699
+ * to use in addition to the ones registered by default.
700
+ * <p>Custom argument resolvers are invoked before built-in resolvers except for
701
+ * those that rely on the presence of annotations (e.g. {@code @RequestParameter},
702
+ * {@code @PathVariable}, etc). The latter can be customized by configuring the
709
703
* {@link RequestMappingHandlerAdapter} directly.
710
- * @param argumentResolvers the list of custom converters;
711
- * initially an empty list.
704
+ * @param argumentResolvers the list of custom converters (initially an empty list)
712
705
*/
713
706
protected void addArgumentResolvers (List <HandlerMethodArgumentResolver > argumentResolvers ) {
714
707
}
715
708
716
709
/**
717
710
* Provide access to the shared return value handlers used by the
718
- * {@link RequestMappingHandlerAdapter} and the
719
- * {@link ExceptionHandlerExceptionResolver}. This method cannot be
720
- * overridden, use {@link #addReturnValueHandlers(List)} instead.
711
+ * {@link RequestMappingHandlerAdapter} and the {@link ExceptionHandlerExceptionResolver}.
712
+ * <p>This method cannot be overridden; use {@link #addReturnValueHandlers} instead.
721
713
* @since 4.3
722
714
*/
723
715
protected final List <HandlerMethodReturnValueHandler > getReturnValueHandlers () {
@@ -729,27 +721,23 @@ protected final List<HandlerMethodReturnValueHandler> getReturnValueHandlers() {
729
721
}
730
722
731
723
/**
732
- * Add custom {@link HandlerMethodReturnValueHandler HandlerMethodReturnValueHandlers} in addition to the
733
- * ones registered by default.
734
- * <p>Custom return value handlers are invoked before built-in ones except
735
- * for those that rely on the presence of annotations (e.g.
736
- * {@code @ResponseBody}, {@code @ModelAttribute}, etc.).
737
- * The latter can be customized by configuring the
724
+ * Add custom {@link HandlerMethodReturnValueHandler HandlerMethodReturnValueHandlers}
725
+ * in addition to the ones registered by default.
726
+ * <p>Custom return value handlers are invoked before built-in ones except for
727
+ * those that rely on the presence of annotations (e.g. {@code @ResponseBody},
728
+ * {@code @ModelAttribute}, etc). The latter can be customized by configuring the
738
729
* {@link RequestMappingHandlerAdapter} directly.
739
- * @param returnValueHandlers the list of custom handlers;
740
- * initially an empty list.
730
+ * @param returnValueHandlers the list of custom handlers (initially an empty list)
741
731
*/
742
732
protected void addReturnValueHandlers (List <HandlerMethodReturnValueHandler > returnValueHandlers ) {
743
733
}
744
734
745
735
/**
746
- * Provides access to the shared {@link HttpMessageConverter HttpMessageConverters} used by the
747
- * {@link RequestMappingHandlerAdapter} and the
736
+ * Provides access to the shared {@link HttpMessageConverter HttpMessageConverters}
737
+ * used by the {@link RequestMappingHandlerAdapter} and the
748
738
* {@link ExceptionHandlerExceptionResolver}.
749
- * This method cannot be overridden.
750
- * Use {@link #configureMessageConverters(List)} instead.
751
- * Also see {@link #addDefaultHttpMessageConverters(List)} that can be
752
- * used to add default message converters.
739
+ * <p>This method cannot be overridden; use {@link #configureMessageConverters} instead.
740
+ * Also see {@link #addDefaultHttpMessageConverters} for adding default message converters.
753
741
*/
754
742
protected final List <HttpMessageConverter <?>> getMessageConverters () {
755
743
if (this .messageConverters == null ) {
@@ -764,32 +752,30 @@ protected final List<HttpMessageConverter<?>> getMessageConverters() {
764
752
}
765
753
766
754
/**
767
- * Override this method to add custom {@link HttpMessageConverter HttpMessageConverters} to use
768
- * with the {@link RequestMappingHandlerAdapter} and the
769
- * {@link ExceptionHandlerExceptionResolver}. Adding converters to the
770
- * list turns off the default converters that would otherwise be registered
771
- * by default. Also see {@link #addDefaultHttpMessageConverters(List)} that
772
- * can be used to add default message converters.
773
- * @param converters a list to add message converters to;
774
- * initially an empty list.
755
+ * Override this method to add custom {@link HttpMessageConverter HttpMessageConverters}
756
+ * to use with the {@link RequestMappingHandlerAdapter} and the
757
+ * {@link ExceptionHandlerExceptionResolver}.
758
+ * <p>Adding converters to the list turns off the default converters that would
759
+ * otherwise be registered by default. Also see {@link #addDefaultHttpMessageConverters}
760
+ * for adding default message converters.
761
+ * @param converters a list to add message converters to (initially an empty list)
775
762
*/
776
763
protected void configureMessageConverters (List <HttpMessageConverter <?>> converters ) {
777
764
}
778
765
779
766
/**
780
- * Override this method to extend or modify the list of converters after it
781
- * has been configured. This may be useful for example to allow default
782
- * converters to be registered and then insert a custom converter through
783
- * this method.
784
- * @param converters the list of configured converters to extend.
767
+ * Override this method to extend or modify the list of converters after it has
768
+ * been configured. This may be useful for example to allow default converters
769
+ * to be registered and then insert a custom converter through this method.
770
+ * @param converters the list of configured converters to extend
785
771
* @since 4.1.3
786
772
*/
787
773
protected void extendMessageConverters (List <HttpMessageConverter <?>> converters ) {
788
774
}
789
775
790
776
/**
791
777
* Adds a set of default HttpMessageConverter instances to the given list.
792
- * Subclasses can call this method from {@link #configureMessageConverters(List) }.
778
+ * Subclasses can call this method from {@link #configureMessageConverters}.
793
779
* @param messageConverters the list to add the default message converters to
794
780
*/
795
781
protected final void addDefaultHttpMessageConverters (List <HttpMessageConverter <?>> messageConverters ) {
@@ -803,8 +789,8 @@ protected final void addDefaultHttpMessageConverters(List<HttpMessageConverter<?
803
789
try {
804
790
messageConverters .add (new SourceHttpMessageConverter <>());
805
791
}
806
- catch (Error err ) {
807
- // Ignore when no TransformerFactory implementation is available
792
+ catch (Throwable ex ) {
793
+ // Ignore when no TransformerFactory implementation is available...
808
794
}
809
795
messageConverters .add (new AllEncompassingFormHttpMessageConverter ());
810
796
@@ -884,14 +870,12 @@ public SimpleControllerHandlerAdapter simpleControllerHandlerAdapter() {
884
870
}
885
871
886
872
/**
887
- * Returns a {@link HandlerExceptionResolverComposite} containing a list
888
- * of exception resolvers obtained either through
889
- * {@link #configureHandlerExceptionResolvers(List)} or through
890
- * {@link #addDefaultHandlerExceptionResolvers(List)}.
891
- * <p><strong>Note:</strong> This method cannot be made final due to CGLib
892
- * constraints. Rather than overriding it, consider overriding
893
- * {@link #configureHandlerExceptionResolvers(List)}, which allows
894
- * providing a list of resolvers.
873
+ * Returns a {@link HandlerExceptionResolverComposite} containing a list of exception
874
+ * resolvers obtained either through {@link #configureHandlerExceptionResolvers} or
875
+ * through {@link #addDefaultHandlerExceptionResolvers}.
876
+ * <p><strong>Note:</strong> This method cannot be made final due to CGLIB constraints.
877
+ * Rather than overriding it, consider overriding {@link #configureHandlerExceptionResolvers}
878
+ * which allows for providing a list of resolvers.
895
879
*/
896
880
@ Bean
897
881
public HandlerExceptionResolver handlerExceptionResolver () {
@@ -909,29 +893,29 @@ public HandlerExceptionResolver handlerExceptionResolver() {
909
893
910
894
/**
911
895
* Override this method to configure the list of
912
- * {@link HandlerExceptionResolver HandlerExceptionResolvers} to use. Adding resolvers to the list
913
- * turns off the default resolvers that would otherwise be registered by
914
- * default. Also see {@link #addDefaultHandlerExceptionResolvers(List) }
896
+ * {@link HandlerExceptionResolver HandlerExceptionResolvers} to use.
897
+ * <p>Adding resolvers to the list turns off the default resolvers that would otherwise
898
+ * be registered by default. Also see {@link #addDefaultHandlerExceptionResolvers}
915
899
* that can be used to add the default exception resolvers.
916
- * @param exceptionResolvers a list to add exception resolvers to;
917
- * initially an empty list.
900
+ * @param exceptionResolvers a list to add exception resolvers to (initially an empty list)
918
901
*/
919
902
protected void configureHandlerExceptionResolvers (List <HandlerExceptionResolver > exceptionResolvers ) {
920
903
}
921
904
922
905
/**
923
906
* Override this method to extend or modify the list of
924
- * {@link HandlerExceptionResolver HandlerExceptionResolvers} after it has been configured. This may
925
- * be useful for example to allow default resolvers to be registered and then
926
- * insert a custom one through this method.
907
+ * {@link HandlerExceptionResolver HandlerExceptionResolvers} after it has been configured.
908
+ * <p>This may be useful for example to allow default resolvers to be registered
909
+ * and then insert a custom one through this method.
927
910
* @param exceptionResolvers the list of configured resolvers to extend.
928
911
* @since 4.3
929
912
*/
930
913
protected void extendHandlerExceptionResolvers (List <HandlerExceptionResolver > exceptionResolvers ) {
931
914
}
932
915
933
916
/**
934
- * A method available to subclasses for adding default {@link HandlerExceptionResolver HandlerExceptionResolvers}.
917
+ * A method available to subclasses for adding default
918
+ * {@link HandlerExceptionResolver HandlerExceptionResolvers}.
935
919
* <p>Adds the following exception resolvers:
936
920
* <ul>
937
921
* <li>{@link ExceptionHandlerExceptionResolver} for handling exceptions through
0 commit comments