|
|
@@ -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);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|