how do I get the spring correctly the message validation according to my language, I am getting in return mensage the default hibernate validator but not the message that was defined in the annotation @NotEmpt.
@Entity
public class News {
@Id
private Integer idNews;
@NotEmpty(message = "{news.title.error}")
@Column
private String title;
........
}
in my configs:
<!-- locale change using a cookie -->
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver" >
<property name="defaultLocale" value="pt" />
</bean>
<!-- Access resource bundles with the specified basename -->
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames">
<list>
<value>/WEB-INF/i18n/messages</value>
<value>/WEB-INF/i18n/validation</value>
</list>
</property>
</bean>
<!-- JSR-303 -->
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<property name="validationMessageSource" ref="messageSource"/>
</bean>
validation_pt.propertiesfile with the correct keys?<form:errors path="*" cssClass="alert alert-error" element="div"/>