熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java開源技術 >> 正文

Struts從零開始五、Struts中驗證數據實例[6]

2022-06-13   來源: Java開源技術 

  添加驗證規則

  在WEBINF下創建validatonxml這個文件導入引用的dtd添加如下內容

  修改Resource Boundle文件

  英文的資源文件applicationResource_en_USproperties

errorsrequired={} is required

  errorsminlength={} can not be less than {} characters

  errorsmaxlength={} can not be greater than {} characters

  errorsinvalid={} is invalid

  errorsbyte={} must be a byte

  errorsshort={} must be a short

  errorsinteger={} must be an integer

  errorslong={} must be a long

  errorsfloat={} must be a float

  errorsdouble={} must be a double

  errorsdate={} is not a date

  errorsrange={} is not in the range {} through {}

  errorscreditcard={} is an invalid credit card number

  errorsemail={} is an invalid email address

  buttonsubmit=Submit

  buttonreset=Reset

  buttoncancel=Cancel

  labelusername=UserName:

  labelpassword=Password:

  loginformerrorusername=please enter your username

  loginformerrorpassword=please enter your password

  loginformfail=invalidation name and passwordlogin error!

  中文的資源文件applicationResource_zh_CNproperties

  errorsrequired={} 是必須的

  errorsminlength={} 不能少於 {} 個字符

  errorsmaxlength={} 不能多於 {} 個字符

  errorsinvalid={} 是非法的

[]  []  []  []  []  []  []  []  


From:http://tw.wingwit.com/Article/program/Java/ky/201311/29086.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.