分类: 系统运维
2012-01-20 20:41:17
-----------------------------------------------------------------
theme="simple"后
<%@ page language="java" pageEncoding="gbk"%>
<%@taglib prefix = "s" uri = "/struts-tags" %>
<html>
<body>
<s:actionerror/>
----------------
<s:fielderror cssStyle = "color:blue">s:fielderror>
<s:form action = "register" theme = "simple">
<s:textfield name = "username" label = "username">s:textfield>
<s:password name = "password" label = "password">s:password>
<s:password name = "repassword" label = "repassword">s:password>
<s:textfield name = "birthday" label = "birthday">s:textfield>
<s:textfield name = "graduation" label = "graduation">s:textfield>
<s:submit value = "submit">s:submit>
s:form>
body>
html>
theme=”simple”之后
<%@ page language="java" pageEncoding="gbk"%>
<%@taglib prefix = "s" uri = "/struts-tags" %>
<html>
<body>
<s:actionerror/>
----------------
<s:fielderror cssStyle = "color:blue">s:fielderror>
<s:form action = "register" theme = "simple">
username:<s:textfield name = "username" label = "username">s:textfield><br>
password:<s:password name = "password" label = "password">s:password><br>
repassword:<s:password name = "repassword" label = "repassword">s:password><br>
birthday:<s:textfield name = "birthday" label = "birthday">s:textfield><br>
graduation:<s:textfield name = "graduation" label = "graduation">s:textfield><br>
<s:submit value = "submit">s:submit>
s:form>
body>
html>
另外说明:struts2默认提交方式是”post”,而html默认是”get”
零碎知识:
流程:jsp页面,以age为例,当提交age=4后,变到相应的xxxAction中找setAge(4)方法。