Struts之標籤

1.<s:debug></s:debug>: 檢視值棧結構和儲存的資料
2.<s:property value=”ognl表示式”/>:獲取值棧資料
3.<s:iterator value=”ognl表示式”></s:iterator>: 遍歷資料
4.表單標籤

index.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<s:form>
<!-- 普通輸入框 -->
<s:textfield name="resume" label="簡歷"></s:textfield>
<!-- 密碼框 -->
<s:password name="password" label="密碼"></s:password>
<!-- 顯示值和實際值相同 -->
<%-- <s:radio name="sex" list="{'男','女'}" label="性別"></s:radio> --%>
<!-- 單選 -->
<s:radio name="sex" list="#{'man':'男','woman':'女'}" label="性別"></s:radio>
<!-- 多選 -->
<s:checkboxlist name="hobby" list="#{'sleep':'睡覺','game':'遊戲','study':'學習'}" label="興趣"></s:checkboxlist>
<!-- 下拉框 -->
<s:select list="#{'wuhan':'武漢','shenzhen':'深圳','dongguan':'東莞'}"></s:select>
<!-- 上傳 -->
<s:file name="file" label="上傳"></s:file>
<!-- 文字域 -->
<s:textarea rows="4" cols="10" name="beizhu" label="備註"></s:textarea>
<!-- 隱藏 -->
<s:hidden name="qq" value="1234567"></s:hidden>
<!-- 提交 -->
<s:submit value="提交"></s:submit>
<!-- 重置 -->
<s:reset value="重置"></s:reset>
</s:form>
</body>
</html>