【发布时间】:2013-05-08 11:25:49
【问题描述】:
当我尝试在我的 jsp 表单的 int 字段中键入 String 时,我仍然遇到致命错误,而不是正常的表单验证。我在messages.properties(Howto validate Collections in Maps)中添加了typeMismatch=msg,但它没有用。我还能错过什么?
【问题讨论】:
-
Spring MVC 应用程序经常使用两个上下文:ApplicationContext 和 Dispatcher Servlet 上下文。检查
messages.properties在 Dispatcher Servlet 上下文中定义并被他使用。 -
感谢您的回复。我的
messages.properties实际上是messages_fr.properties并且适用于包括验证消息在内的许多其他消息。
标签: spring spring-mvc