Struts的验证--Validator[8]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 zhudaneu 的 blog

        <var>

          <var-name>max</var-name>

          <var-value>100</var-value>

        </var>

      </field>

    </form>

  </formset>

</form-validation>

 

由于validator要从资源文件中读取error messages,所以还要配置资源文件。在com.my包中新建一资源文件,取名为application.properties(扩展名必须为propertyies),其内容如下:

# struts validator error messages

errors.required={0} is required.

errors.minlength={0} can not be less than {1} characters.

errors.maxlength={0} can not be greater than {1} characters.

本文关键:Struts的验证--Validator
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top