Knight of the round table

wansong

struts 1 validate

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


validation.xml:::::::::::::
<formset>
        <!-- An example form -->
        <form name="crudForm">
            <field property="name" depends="required">
                <arg key="crudform.name"/>
            </field>
        </form>
    </formset>

jsp::::::::::

<html:javascript formName="crudForm" dynamicJavascript="true" staticJavascript="true"/>

<div id="crudDetailDialog">
 <html:form action="/save.do" method="POST" styleId="crudForm" >
  <div id="crudDetailValidationMessages"><html:errors/></div>
  
  CrudId:<html:text property="crudId" />
  Name: <html:text property="name" />
  
  <input name="submit" type="submit" value='login' >
 </html:form>
</div>


form:::::::::::::::::::::::
CRUDForm extends ValidatorForm {

posted on 2010-09-22 22:11 w@ns0ng 阅读(185) 评论(0)  编辑  收藏 所属分类: Struts


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


网站导航: