struts检验

1. <?xmlversion="1.0"encoding="UTF-8"?>

2. <!DOCTYPE validators PUBLIC

3. "-//OpenSymphony Group//XWork Validator 1.0.3//EN"

4. "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">

5. <validators>

6. <fieldname="user.name">

7. <field-validatortype="requiredstring">

8. <paramname="trim">true</param>

9. <message>用户名必须输入!</message>

10.</field-validator>

11.<field-validatortype="stringlength">

12.<paramname="minLength">3</param>

13.<paramname="maxLength">6</param>

14.<message>用户名的长度必须在${minLength}${maxLength}之间!</message>

15.</field-validator>

16.</field>

17.<fieldname="user.password">

18.<field-validatortype="requiredstring">

19.<paramname="trim">true</param>

20.<message>请输入密码!</message>

21.</field-validator>

22.</field>

23.<fieldname="again">

24.<field-validatortype="requiredstring">

25.<paramname="trim">true</param>

26.<message>请再次输入密码以做确认!</message>

27.</field-validator>

28.</field>

29.<fieldname="user.sex">

30.<field-validatortype="required">

31.<message>请选择你的性别!</message>

32.</field-validator>

33.</field>

34.<fieldname="user.phone">

35.<field-validatortype="regex">

36.<paramname="expression"><!--[CDATA[^1[358]/d{9}$]]></param>

37.<message>你所输入的手机号有误,请正确输入!</message>

38.</field-validator>

39.</field>

40.<fieldname="user.pid">

41.<field-validatortype="requiredstring">

42.<paramname="trim">true</param>

43.<message>请填写证件号!</message>

44.</field-validator>

45.<field-validatortype="regex">

46.<paramname="expression"><![CDATA[^[1-9]/d{5}[1-9]/d{3}((0/d)|(1[0-2]))(([0|1|2]/d)|3[0-1])/d{4}$]]--></param>

47.<message>你所输入的证件号有误,请正确输入!</message>

48.</field-validator>

49.</field>

50.<fieldname="user.birthday">

51.<field-validatortype="required">

52.<message>请输入生日!</message>

53.</field-validator>

54.<field-validatortype="date">

55.<message>你所输入的日期格式有误码,请正确输入!</message>

56.</field-validator>

57.</field>

58.<fieldname="user.email">

59.<field-validatortype="requiredstring">

60.<paramname="trim">true</param>

61.<message>请输入电子邮件</message>

62.</field-validator>

63.<field-validatortype="email">

64.<message>你所输入的EMAIL格式有误,请正确输入!</message>

65.</field-validator>

66.</field>

67.<fieldname="user.blog">

68.<field-validatortype="requiredstring">

69.<paramname="trim">true</param>

70.<message>请输入个人网址</message>

71.</field-validator>

72.<field-validatortype="url">

73.<message>你所输入的网址格式有误,请正确输入!</message>

74.</field-validator>

75.</field>

76.</validators>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值