我有一个使用jsr 303如何强制它使用我的资源包?
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="/WEB-INF/messages" />
</bean>
除了验证其确实更复杂的验证我也用JSR303像
@NotNull(message="null value is not allowed")
protected String postCode;
我要为JSR使用相同的文件源的消息验证器类。
@NotNull(message=<SOMEHOW GO TO MY messages_en_US.properties AND EXTRACT SOMETHING LIKE : user.poscode.null>)
谢谢!
看一看[这个问题(表现http://stackoverflow.com/questions/ 6246381 /从本地化的消息 - 从资源捆绑 - 通过annotations-in-spring-framewor) - 它似乎有一个解决方案。 – Bringer128
这没有帮助,我根据类似但不相同的主题评估答案真的很糟糕:-( – Aubergine