Browse Source

修改web mvc

guq 7 years ago
parent
commit
a471255c83

+ 2 - 4
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/config/WebConfig.java

@@ -8,7 +8,7 @@ import org.springframework.http.converter.HttpMessageConverter;
 import org.springframework.http.converter.StringHttpMessageConverter;
 import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
 import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
@@ -21,7 +21,7 @@ import java.util.List;
  **/
 
 @Configuration
-public class WebConfig extends WebMvcConfigurationSupport{
+public class WebConfig implements WebMvcConfigurer {
     @Bean
     public HttpMessageConverter<String> responseBodyConverter() {
         StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
@@ -40,7 +40,6 @@ public class WebConfig extends WebMvcConfigurationSupport{
 
     @Override
     public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
-        super.configureMessageConverters(converters);
         converters.add(responseBodyConverter());
         converters.add(MappingJacksonHttpMessageConverter());
     }
@@ -49,5 +48,4 @@ public class WebConfig extends WebMvcConfigurationSupport{
     public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
         configurer.favorPathExtension(false);
     }
-
 }

+ 3 - 4
applications/document/document-server/src/main/java/com/usoftchina/saas/document/config/WebConfig.java

@@ -8,7 +8,7 @@ import org.springframework.http.converter.HttpMessageConverter;
 import org.springframework.http.converter.StringHttpMessageConverter;
 import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
 import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
@@ -21,7 +21,7 @@ import java.util.List;
  **/
 
 @Configuration
-public class WebConfig extends WebMvcConfigurationSupport{
+public class WebConfig implements WebMvcConfigurer {
     @Bean
     public HttpMessageConverter<String> responseBodyConverter() {
         StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
@@ -40,7 +40,6 @@ public class WebConfig extends WebMvcConfigurationSupport{
 
     @Override
     public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
-        super.configureMessageConverters(converters);
         converters.add(responseBodyConverter());
         converters.add(MappingJacksonHttpMessageConverter());
     }
@@ -49,6 +48,6 @@ public class WebConfig extends WebMvcConfigurationSupport{
     public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
         configurer.favorPathExtension(false);
     }
-
 }
 
+

+ 2 - 4
applications/money/money-server/src/main/java/com/usoftchina/saas/money/config/WebConfig.java

@@ -8,7 +8,7 @@ import org.springframework.http.converter.HttpMessageConverter;
 import org.springframework.http.converter.StringHttpMessageConverter;
 import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
 import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
@@ -21,7 +21,7 @@ import java.util.List;
  **/
 
 @Configuration
-public class WebConfig extends WebMvcConfigurationSupport{
+public class WebConfig implements WebMvcConfigurer {
     @Bean
     public HttpMessageConverter<String> responseBodyConverter() {
         StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
@@ -40,7 +40,6 @@ public class WebConfig extends WebMvcConfigurationSupport{
 
     @Override
     public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
-        super.configureMessageConverters(converters);
         converters.add(responseBodyConverter());
         converters.add(MappingJacksonHttpMessageConverter());
     }
@@ -49,6 +48,5 @@ public class WebConfig extends WebMvcConfigurationSupport{
     public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
         configurer.favorPathExtension(false);
     }
-
 }
 

+ 3 - 4
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/config/WebConfig.java

@@ -8,7 +8,7 @@ import org.springframework.http.converter.HttpMessageConverter;
 import org.springframework.http.converter.StringHttpMessageConverter;
 import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
 import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
@@ -20,8 +20,9 @@ import java.util.List;
  * @create: 2018-10-30 11:20
  **/
 
+
 @Configuration
-public class WebConfig extends WebMvcConfigurationSupport{
+public class WebConfig implements WebMvcConfigurer {
     @Bean
     public HttpMessageConverter<String> responseBodyConverter() {
         StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
@@ -40,7 +41,6 @@ public class WebConfig extends WebMvcConfigurationSupport{
 
     @Override
     public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
-        super.configureMessageConverters(converters);
         converters.add(responseBodyConverter());
         converters.add(MappingJacksonHttpMessageConverter());
     }
@@ -49,6 +49,5 @@ public class WebConfig extends WebMvcConfigurationSupport{
     public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
         configurer.favorPathExtension(false);
     }
-
 }