File tree Expand file tree Collapse file tree 1 file changed +3
-22
lines changed 
Chapter3-1-8/src/main/java/com/didispace Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Original file line number Diff line number Diff line change 22
33import  org .springframework .boot .SpringApplication ;
44import  org .springframework .boot .autoconfigure .SpringBootApplication ;
5- import  org .springframework .context .annotation .Configuration ;
6- import  org .springframework .http .converter .HttpMessageConverter ;
7- import  org .springframework .http .converter .json .Jackson2ObjectMapperBuilder ;
8- import  org .springframework .http .converter .xml .MappingJackson2XmlHttpMessageConverter ;
9- import  org .springframework .web .servlet .config .annotation .WebMvcConfigurerAdapter ;
10- 
11- import  java .util .List ;
125
136/** 
14-  * 
157 * @author 程序猿DD 
168 * @version 1.0.0 
179 * @blog http://blog.didispace.com 
18-  * 
1910 */ 
2011@ SpringBootApplication 
2112public  class  Application  {
2213
23- 	public  static  void  main (String [] args ) {
24- 		SpringApplication .run (Application .class , args );
25- 	}
26- 
27- 	@ Configuration 
28- 	class  MessageConverterConfig  extends  WebMvcConfigurerAdapter  {
29- 		@ Override 
30- 		public  void  configureMessageConverters (List <HttpMessageConverter <?>> converters ) {
31- 			Jackson2ObjectMapperBuilder  builder  = Jackson2ObjectMapperBuilder .xml ();
32- 			builder .indentOutput (true );
33- 			converters .add (new  MappingJackson2XmlHttpMessageConverter (builder .build ()));
34- 		}
35- 	}
14+     public  static  void  main (String [] args ) {
15+         SpringApplication .run (Application .class , args );
16+     }
3617
3718}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments