Unless I am mistaken, HttpMessageConverters is used on both client and server to provide a default set of message converters. In the process of determining those defaults, the RestTemplate is used. This has the unfortunate consequence that framework converters written to only be used on the client-side are also registered on the server. Specifically, the AllEncompassingFormHttpMessageConverter is set up.
The end result of the above is that Spring MVC (when used with Boot) is capable of writing forms on the server side, which does not make any sense. In Framework, we distinguish between converters for the client side and server side. I suggest that Spring Boot should make the same distinction.
Comment From: wilkinsona
In the process of determining those defaults, the RestTemplate is used
That shouldn't be the case in a servlet-based web app. When org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport is on the classpath, its default converters are used rather than those of RestTemplate:
https://github.com/spring-projects/spring-boot/blob/d26881acb42161aae2af854d4c93df83d7dfef81/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConverters.java#L184-L201
MVC includes an instance of AllEncompassingFormHttpMessageConverter by default so Boot does too. Unless I've missed something, if a distinction is to be made here, it should be made in Spring MVC and Boot will then pick up that change automatically.
Comment From: poutsma
You are correct; I was mistaken. We are—mistakenly I'd argue—registering the AllEncompassingFormHttpMessageConverter on the server side.
Comment From: poutsma
See https://github.com/spring-projects/spring-framework/issues/32917