Skip to content

Commit a702ef8

Browse files
nkjackzhangsdeleuze
authored andcommitted
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.
1 parent f7376bd commit a702ef8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/docs/asciidoc/web/webmvc.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4162,6 +4162,7 @@ In Java config, customize requested content type resolution:
41624162
@Override
41634163
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
41644164
configurer.mediaType("json", MediaType.APPLICATION_JSON);
4165+
configurer.mediaType("xml", MediaType.APPLICATION_XML);
41654166
}
41664167
}
41674168
----
@@ -4212,7 +4213,7 @@ Below is an example that adds Jackson JSON and XML converters with a customized
42124213
.dateFormat(new SimpleDateFormat("yyyy-MM-dd"))
42134214
.modulesToInstall(new ParameterNamesModule());
42144215
converters.add(new MappingJackson2HttpMessageConverter(builder.build()));
4215-
converters.add(new MappingJackson2XmlHttpMessageConverter(builder.xml().build()));
4216+
converters.add(new MappingJackson2XmlHttpMessageConverter(builder.createXmlMapper(true).build()));
42164217
}
42174218
}
42184219
----
@@ -4389,7 +4390,7 @@ In Java config simply add the respective "Configurer" bean:
43894390
@Bean
43904391
public FreeMarkerConfigurer freeMarkerConfigurer() {
43914392
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
4392-
configurer.setTemplateLoaderPath("/WEB-INF/");
4393+
configurer.setTemplateLoaderPath("/freemarker");
43934394
return configurer;
43944395
}
43954396
}
@@ -4683,7 +4684,7 @@ hook of the Spring `ApplicationContext`:
46834684
----
46844685

46854686
Note that `MyPostProcessor` needs to be declared as a bean either explicitly in XML or
4686-
detected through a `<component scan/>` declaration.
4687+
detected through a `<component-scan/>` declaration.
46874688

46884689

46894690

0 commit comments

Comments
 (0)