spring-projects/spring-boot — pull request #670 by marceloverdijk (2014-04-28 19:10:35+00:00)
Title: Support setting the MessageCodeResolver format

In traditional non-Spring Boot app I would set MessageCodeResolver format like:

@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {

@Override
public MessageCodesResolver getMessageCodesResolver() {
DefaultMessageCodesResolver messageCodesResolver = new DefaultMessageCodesResolver();
messageCodesResolver.setMessageCodeFormatter(DefaultMessageCodesResolver.Format.POSTFIX_ERROR_CODE);
return messageCodesResolver;
}

Would be nice if Spring Boot could support this automatically by setting the format via an application property like:

spring.messages.resolver.format: prefix # prefix or postfix

See http://docs.spring.io/spring/docs/4.0.3.RELEASE/javadoc-api/org/springframework/validation/DefaultMessageCodesResolver.Format.html