<%@ page language="java" pageEncoding="GB2312"%><%@ taglib prefix="s" uri="/struts-tags"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>Huy Vanpull's exercise of struts 2.0 tags</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <style type="text/css">.inputStyle {}{ width: 120px; height: 20px; color: red;}</style> </head> <body> <span>表单标签练习:<br /> </span> <s:form id="sform" name="sform" action="userAdd" namespace="/example" method="post" theme="simple" onsubmit="return test()"> <s:hidden id="userId" name="user.userId" /> UserName:<s:textfield id="userName" name="user.userName" value="Huyvanpull" maxlength="16" cssClass="inputStyle" /> <br /> Password:<s:password id="password" name="user.password" maxlength="16" cssClass="inputStyle" /> <br /> Gender:<s:radio id="gender" name="user.gender" list="#{'male':'男','female':'女'}" value="'male'"/> <br /> Educat:<s:select id="education" name="user.education" headerKey="-1" headerValue="请选择学历" list="#{'0':'小学', '1':'初中', '2':'高中','3':'专科','4':'本科'}" value="4" required="true" cssClass="inputStyle" /> <br /> Interest:<s:checkbox id="interest1" name="user.interest1" value="true" fieldValue="1" /> <br /> Remark:<s:textarea id="remark" name="user.remark" value="rea" onfocus="this.select();" cssClass="inputStyle" /> <br /> <s:token /> </s:form> </body></html>