From d44f1ca2daec03b0ff0023da580e176d753a5426 Mon Sep 17 00:00:00 2001 From: nkjackzhang Date: Thu, 26 Apr 2018 09:56:14 +0800 Subject: [PATCH] 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. --- src/docs/asciidoc/web/webmvc.adoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/docs/asciidoc/web/webmvc.adoc b/src/docs/asciidoc/web/webmvc.adoc index 095bb07568..ca449b61a7 100644 --- a/src/docs/asciidoc/web/webmvc.adoc +++ b/src/docs/asciidoc/web/webmvc.adoc @@ -4162,6 +4162,7 @@ In Java config, customize requested content type resolution: @Override public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { 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")) .modulesToInstall(new ParameterNamesModule()); 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 public FreeMarkerConfigurer freeMarkerConfigurer() { FreeMarkerConfigurer configurer = new FreeMarkerConfigurer(); - configurer.setTemplateLoaderPath("/WEB-INF/"); + configurer.setTemplateLoaderPath("/freemarker"); 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 -detected through a `` declaration. +detected through a `` declaration. -- GitLab