Fix typos in Spring MVC refdoc
1. Consistent with "xml code" examples. 2. "xml()" is a static method and will use default builder config, so use createXmlMapper(true) instead. 3. Fix mvc namespace tag typo.
This commit is contained in:
parent
9bc4e70e93
commit
d44f1ca2da
|
@ -4162,6 +4162,7 @@ In Java config, customize requested content type resolution:
|
||||||
@Override
|
@Override
|
||||||
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
|
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
|
||||||
configurer.mediaType("json", MediaType.APPLICATION_JSON);
|
configurer.mediaType("json", MediaType.APPLICATION_JSON);
|
||||||
|
configurer.mediaType("xml", MediaType.APPLICATION_XML);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
@ -4212,7 +4213,7 @@ Below is an example that adds Jackson JSON and XML converters with a customized
|
||||||
.dateFormat(new SimpleDateFormat("yyyy-MM-dd"))
|
.dateFormat(new SimpleDateFormat("yyyy-MM-dd"))
|
||||||
.modulesToInstall(new ParameterNamesModule());
|
.modulesToInstall(new ParameterNamesModule());
|
||||||
converters.add(new MappingJackson2HttpMessageConverter(builder.build()));
|
converters.add(new MappingJackson2HttpMessageConverter(builder.build()));
|
||||||
converters.add(new MappingJackson2XmlHttpMessageConverter(builder.xml().build()));
|
converters.add(new MappingJackson2XmlHttpMessageConverter(builder.createXmlMapper(true).build()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
@ -4389,7 +4390,7 @@ In Java config simply add the respective "Configurer" bean:
|
||||||
@Bean
|
@Bean
|
||||||
public FreeMarkerConfigurer freeMarkerConfigurer() {
|
public FreeMarkerConfigurer freeMarkerConfigurer() {
|
||||||
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
|
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
|
||||||
configurer.setTemplateLoaderPath("/WEB-INF/");
|
configurer.setTemplateLoaderPath("/freemarker");
|
||||||
return configurer;
|
return configurer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4683,7 +4684,7 @@ hook of the Spring `ApplicationContext`:
|
||||||
----
|
----
|
||||||
|
|
||||||
Note that `MyPostProcessor` needs to be declared as a bean either explicitly in XML or
|
Note that `MyPostProcessor` needs to be declared as a bean either explicitly in XML or
|
||||||
detected through a `<component scan/>` declaration.
|
detected through a `<component-scan/>` declaration.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue