Problem with properties Spring MVC 4

Asked

Viewed 278 times

1

Well the error happens in the second message from the file "properties" the first ok message when I try to put the second the message in the file happens this error

Caused by: javax.servlet.jsp.Jsptagexception: No message found under code 'field.add' for locale 'pt_br'.

message file.properties

campo.obrigatorio= Este campo é Obrigatório
campo.add= Add
campo.update= Editar

@Bean
public static MessageSource messageSource() {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.setBasename("classpath:mensagem");
messageSource.setDefaultEncoding("UTF-8");
return messageSource;
}
  • Try renaming the file to message_pt_BR.properties

  • Do messageSource.setFallbackToSystemLocale(false), should work. This is good even when it supports multiple languages, keep in a standard all, to avoid errors :)

  • sorry for the delay today I will test.

  • continues the same error No message found under code 'field.add' for locale 'pt_br'. that <spring:message code="required field"/></span> <spring:message code="field.add"/> in OK

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.