您的位置:程序门 -> java -> j2ee / ejb / jms



在多模块的有多个配置文件的struts中怎么配置validator验证框架?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


在多模块的有多个配置文件的struts中怎么配置validator验证框架?
发表于:2007-09-14 10:27:54 楼主
我的项目有多个模块,配置了多个struts配置文件,比如有struts-config.xml和struts-config-transaction.xml,现在我想加上validator验证框架,对struts-config.xml和struts-config-transaction.xml中的各个action都有校验,我需要把
<plug-in   classname= "org.apache.struts.validator.validatorplugin ">
    <set-property   property= "pathnames "  
                                value= "/web-inf/conf/validate/validator-rules.xml,
                                              /web-inf/conf/validate/validation-global.xml,
                                              /web-inf/conf/validate/validation-transaction.xml "
    />
</plug-in>
配在哪呢?还是两个配置文件都需要?
还有,validator框架需要一个.properties文件配置国际化消息,但是struts-config.xml和struts-config-transaction.xml中已经有默认的不带key的类似于
<message-resources   parameter= "transaction "   />
的设置,validator需要的这个.properties文件如何配置呢?
发表于:2007-09-14 10:30:401楼 得分:0
看看...我似乎还没玩这么复杂的多个validator文件~
应该是那个struts配置文件需要就写在哪里吧?
发表于:2007-09-14 11:13:372楼 得分:0
3个都要的吧
多个配置的时候他是根据你的代码跳来跳去的
所以在当前的一个配置如果没plugin   那个应该就会报错了
发表于:2007-09-17 11:43:443楼 得分:0
那properties文件如何配置呢?


快速检索

最新资讯
热门点击