struts2开发_validation_struts2客户端校验(二)

2014-11-24 07:39:57 · 作者: · 浏览: 1
5
66
67
68
69 1950-01-01
70 2100-01-01
71 生日必须在${min}到${max}之间
72

73

74
75
76
77
78
79 你输入的邮箱必须是一个有效,如:example@163.com
80

81

82
83
84
85
86
87 你输入的个人主页地址必须有效,如:http://www.example.com>
88

89
90

91

/struts2_0200_validation/src/struts-validation.xml
1 < xml version="1.0" encoding="GBK" >
2 3 "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
4 "
http://struts.apache.org/dtds/struts-2.1.7.dtd">
5
6
7
8
9
10 /regist.jsp
11 /show.jsp
12

13
14 .
15

16

17

/struts2_0200_validation/src/struts.xml
1 < xml version="1.0" encoding="GBK" >
2 3 "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
4 "http://struts.apache.org/dtds/struts-2.1.7.dtd">
5
6
7
8
9

/struts2_0200_validation/WebRoot/regist.jsp
1 <%@ page contentType="text/html; charset=GBK" language="java" errorPage="" %>
2 <%@taglib prefix="s" uri="/struts-tags"%>
3 4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5 http://www.w3.org/1999/xhtml">
6
7
8 请输入您的注册信息
9
10
11
12
13
14

请输入您的注册信息


15
16
17
18
19
20
21
22
23
24
25

26
27

/struts2_0200_validation/WebRoot/show.jsp
1 <%@ page contentType="text/html; charset=GBK" language="java" errorPage="" %>
2 <%@taglib prefix="s" uri="/struts-tags"%>
3 4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5 http://www.w3.org/1999/xhtml">
6
7
8 校验成功
9
10
11
12
13
14

校验成功


15 用户名:

16 密码:

17 工资:

18 年龄:

19 生日:

20 邮箱:

21 个人主页:
22
23
24 html>

摘自 Hongten