Polish
This commit is contained in:
@@ -31,8 +31,8 @@ import org.springframework.context.annotation.Import;
|
||||
* <pre class="code">
|
||||
* @Configuration
|
||||
* @EnableWebMvc
|
||||
* @ComponentScan(basePackageClasses = { MyConfiguration.class })
|
||||
* public class MyWebConfiguration {
|
||||
* @ComponentScan(basePackageClasses = MyConfiguration.class)
|
||||
* public class MyConfiguration {
|
||||
*
|
||||
* }
|
||||
* </pre>
|
||||
@@ -44,7 +44,7 @@ import org.springframework.context.annotation.Import;
|
||||
* <pre class="code">
|
||||
* @Configuration
|
||||
* @EnableWebMvc
|
||||
* @ComponentScan(basePackageClasses = { MyConfiguration.class })
|
||||
* @ComponentScan(basePackageClasses = MyConfiguration.class)
|
||||
* public class MyConfiguration extends WebMvcConfigurerAdapter {
|
||||
*
|
||||
* @Override
|
||||
@@ -57,12 +57,17 @@ import org.springframework.context.annotation.Import;
|
||||
* converters.add(new MyHttpMessageConverter());
|
||||
* }
|
||||
*
|
||||
* // More overridden methods ...
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* <p>If {@link WebMvcConfigurer} does not expose some advanced setting that
|
||||
* needs to be configured, consider removing the {@code @EnableWebMvc}
|
||||
* <p><strong>Note:</strong> only one {@code @Configuration} class may have the
|
||||
* {@code @EnableWebMvc} annotation to import the Spring Web MVC
|
||||
* configuration. There can however be multiple {@code @Configuration} classes
|
||||
* implementing {@code WebMvcConfigurer} in order to customize the provided
|
||||
* configuration.
|
||||
*
|
||||
* <p>If {@link WebMvcConfigurer} does not expose some more advanced setting that
|
||||
* needs to be configured consider removing the {@code @EnableWebMvc}
|
||||
* annotation and extending directly from {@link WebMvcConfigurationSupport}
|
||||
* or {@link DelegatingWebMvcConfiguration}, e.g.:
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user