|
|
@@ -3,6 +3,7 @@ package com.usoftchina.uas.office.qywx.config;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
+import org.springframework.http.MediaType;
|
|
|
import org.springframework.http.converter.HttpMessageConverter;
|
|
|
import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter;
|
|
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
|
|
@@ -10,6 +11,8 @@ import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
|
|
|
|
|
|
+import java.nio.charset.Charset;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -39,15 +42,12 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|
|
registry.addViewController("/corp").setViewName("corp.html");
|
|
|
}
|
|
|
|
|
|
- @Bean
|
|
|
- public RequestMappingHandlerAdapter requestMappingHandlerAdapter() {
|
|
|
- RequestMappingHandlerAdapter adapter = new RequestMappingHandlerAdapter();
|
|
|
- List<HttpMessageConverter<?>> converters = adapter.getMessageConverters();
|
|
|
- MappingJackson2XmlHttpMessageConverter xmlConverter = new MappingJackson2XmlHttpMessageConverter();
|
|
|
- converters.add(xmlConverter);
|
|
|
- adapter.setMessageConverters(converters);
|
|
|
- return adapter;
|
|
|
+ @Override
|
|
|
+ public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
|
|
+ MappingJackson2XmlHttpMessageConverter xmlHttpMessageConverter = new MappingJackson2XmlHttpMessageConverter();
|
|
|
+ converters.add(xmlHttpMessageConverter);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|