2005-04-07

Struts - Validator 集成注意事项

  • 在struts主配置文件struts-config.xml中加入Validator plug-in
  • 改变form对象所继承的父类为ValidatorForm或其子类
  • Once you have configured the Validator Plug-In, so that it can load your Validator Resources you just have to extend org.apache.struts.validator.action.ValidatorForm instead of org.apache.struts.action.ActionForm
  • validator的前台javascript验证默认采用commons-validator中的定义
  • Starting in Struts 1.2.0 the default javascript definitions have been consolidated to commons-validator. The default can be overridden by supplying a element with a CDATA section, just as in struts 1.1.
  • field定义中的msg,arg子元素中的属性name指的是对应验证器名称:mask,...

0 Comments:

Post a Comment

<< Home