posts - 9, comments - 8, trackbacks - 0, articles - 3
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Struts ValidatorResources 的警告问题

Posted on 2006-12-10 00:13 Dr.Water 阅读(2708) 评论(3)  编辑  收藏 所属分类: Java 随手贴

Struts  ValidatorResources 的警告问题

google到的其他人同样的问题描述
http://www.mail-archive.com/user@struts.apache.org/msg51847.html


我自己的配置
struts-config-action.xml中配置

< form-beans >
    
< form-bean  name ="dynamicForm"  type ="org.apache.struts.validator.LazyValidatorForm" />
</ form-beans >

运行所有跟这个form有关的页面都会出现:
[ValidatorResources]2006-12-10 00:07:23 WARN : Form 'dynamicForm' not found for locale 'zh_CN'

我即使在messageResource_zh_CN.properties添加了对应的key/name也不行.

解决方法,参考其他帖子,我首先升级strut 到1.3.x,commons-validator也升级到1.3.0
然后

  < plug-in  className ="org.apache.struts.validator.ValidatorPlugIn" >
  
< set-property  property ="pathnames"
       value
="/WEB-INF/validator-rules.xml,/WEB-INF/validation-user.xml" />
 
</ plug-in >


在validation-user.xml 添加一个form就行了

< form-validation >
 
< formset >
  
< form  name ="dynamicForm" />
 
</ formset >
</ form-validation >

不再有这个WARN 了。 


评论

# re: Struts ValidatorResources 的警告问题  回复  更多评论   

2007-09-22 16:55 by sgwood
可是我的warn是这个:
WARN [org.apache.commons.validator.ValidatorResources] - <Form 'null' not found for locale 'zh_CN'>
我就真得不知道原因了。。。

# re: Struts ValidatorResources 的警告问题  回复  更多评论   

2007-09-22 16:59 by sgwood
希望博主有什么建议请发一封email给我:jipinceo@163.com

# re: Struts ValidatorResources 的警告问题  回复  更多评论   

2008-12-09 07:02 by dava
我也预到这问题,原来是struts的bug,见
https://issues.apache.org/struts/browse/STR-2712
有补丁

只有注册用户登录后才能发表评论。


网站导航: