| 標籤 | 用途 | 關鍵屬性 |
|---|---|---|
<html:form> | 建立表單,必須指定 action | action, method, enctype, styleClass, target, onsubmit, onreset |
<html:text> | 單行文字輸入框 | property, size, maxlength, readonly, disabled, styleClass, onchange, onblur... |
<html:password> | 密碼輸入框 | property, size, maxlength, readonly, disabled, redisplay, onchange... |
<html:hidden> | 隱藏欄位 | property, value |
<html:textarea> | 多行文字區域 | property, rows, cols, readonly, disabled, onchange... |
<html:submit> | 提交按鈕 | property, value, disabled, styleClass, onclick... |
<html:cancel> | 取消按鈕,觸發 Action 取消事件 | property, value, onclick... |
<html:radio> | 單選按鈕 | property, value, disabled, styleClass, onclick... |
<html:checkbox> | 核取方塊 | property, value, disabled, styleClass, onclick... |
<html:multibox> | 多值核取方塊(對應陣列/集合屬性) | property, value, disabled, styleClass, onclick... |
<html:select> | 下拉選單/多選列表 | property, multiple, disabled, styleClass, onchange... 內含 <html:option>/<html:options>/<html:optionsCollection> |
<html:file> | 檔案上傳欄位 | property, size, maxlength, disabled, accept... 表單需 enctype="multipart/form-data" method="post" |
幾乎所有標籤均支援:onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup。
title:直接指定提示文字。titleKey:從 Message Resources 取值(國際化)。style:內聯 CSS。styleClass:CSS 類名。<html:form> 缺少 action 會拋異常。enctype="multipart/form-data" 並對應 FormFile 屬性。property 需與 ActionForm 中屬性類型匹配(Boolean/String/陣列)。