MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » 关于validator验证的有关问题

关于validator验证的有关问题

www.MyException.Cn  网友分享于:2013-12-25  浏览:7次
关于validator验证的问题
抛出如下异常:
java.lang.IllegalArgumentException:   Resources   cannot   be   null.
org.apache.commons.validator.Validator. <init> (Validator.java:188)
org.apache.struts.validator.Resources.initValidator(Resources.java:475)
org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorForm.java:104)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:928)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:204)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

我的struts-config.xml如下:


<struts-config>
  <form-beans>
  <form-bean   name= "registerForm "   type= "org.apache.struts.validator.DynaValidatorForm ">

  <form-property   name= "name "   type= "java.lang.String "/>
  <forn-property   name= "email "   type= "java.lang.String "/>
 
  </form-bean>
  </form-beans>
  <action-mappings>
  <action   path= "/validate "  
                      type= "com.yourcompany.struts.Register "
                      name= "registerForm "  
                      scope= "request "
                      validate= "true "
                      input= "/MyHtml.html ">
                      <forward   name= "success "   path= "/success.jsp "/>
  </action>
  </action-mappings>
    <message-resources   parameter= "com.yourcompany.struts.ApplicationResources "   />
    <plug-in   className= "org.apache.struts.validator.ValidatorPlugIn ">
    <set-Property   property= "pathnames "
    value= "/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml "/>
    </plug-in>
</struts-config>
我的validation.xml如下:
<?xml   version= "1.0 "   encoding= "UTF-8 "?>
<form-validation>
<formset>
<form   name= "registerForm ">
<filed
property= "name "
depends= "required,minlength ">
<args0   name= "minlength "   key= "${var:minlength} "   resource= "false "/>
<var>
<var-name> minlength </var-name>
<var-value> 7 </var-value>
</var>
</filed>
<field  
property= "email "
depends= "required,minlength,eamil "
>
</field>
</form>
</formset>
</form-validation>
请问是什么错误!!




------解决方案--------------------
資源文件里寫相應的內容了嗎??

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有