html:form
<html:form action="/employee.do?actionType=update" method="POST" οnsubmit="return checkdata();">
属性 | 说明 |
action (必填) | /xxx.do 前面不要加request.getContextPath() |
enctype | 如要进行档案上传,必须指定为 enctype=”multipart/form-data” |
method | 预设为POST,可不写 |
onsubmit | 窗体送出时,会执行的JavaScript |
html:submit
<html:submit value="储存" />
属性 | 说明 |
disabled | 想把按钮设为无效,请指定为true |
value | 按钮上面会显示的字 |
html:reset
<html:reset value="重写" />
属性 | 说明 |
disabled | 想把按钮设为无效,请指定为true |
value | 按钮上面会显示的字 |
html:text
<html:text property="chineseName" size="15" styleClass="input"/>
属性 | 说明 |
property(必填) | 传送的参数名称 |
value | 初始值 |
size | 字段大小 |
styleClass | 指定要使用的css style |
disabled | 想使字段设为无效,请指定为true |
readonly | 只能显示,不可输入资料。请指定为true |
maxlength | 可输入的最大字数 |
html:textarea
<html:textarea property="remark" cols="30" rows="4" styleClass="input"/>
属性 | 说明 |
property(必填) | 传送的参数名称 |
value | 初始值 |
cols | 字段每行的字符数 |
rows | 字段的行数 |
styleClass | 指定要使用的css style |
disabled | 想使字段设为无效,请指定为true |
readonly | 只能显示,不可输入资料。请指定为true |
html:password
<html:password property="password" size="20" styleClass="input"/>
属性 | 说明 |
property(必填) | 传送的参数名称 |
value | 初始值 |
size | 字段大小 |
styleClass | 指定要使用的css style |
disabled | 想使字段设为无效,请指定为true |
readonly | 只能显示,不可输入资料。请指定为true |
maxlength | 可输入的最大字数 |
html:checkbox(multibox)
<html:multibox property="interestArray" value="A"/> 打球
属性 | 说明 |
property(必填) | 传送的参数名称(name) |
value | 传送的参数值(value) |
styleClass | 指定要使用的css style |
disabled | 想使字段设为无效,请指定为true |
html:radio
<html:radio property="sex" value="M">男</html:radio>
属性 | 说明 |
property(必填) | 传送的参数名称(name) |
value | 传送的参数值(value) |
styleClass | 指定要使用的css style |
disabled | 想使字段设为无效,请指定为true |
html:select (要搭配 html:option)
<html:select property="unit" styleClass="text-bk-11">
<html:option value="1">业务部</html:option>
<html:option value="2">专案部</html:option>
<html:option value="3">测试部</html:option>
<html:option value="4">研发部</html:option>
</html:select>
属性 | 说明 |
property(必填) | 传送的参数名称(name) |
value | 传送的参数值(value) |
styleClass | 指定要使用的css style |
multiple | 想要产生可复选的下拉式选单,请指定为true |
size | 要显示的项目数量 |
disabled | 想使字段设为无效,请指定为true |
html:option (要搭配 html:select)
属性 | 说明 |
value | 传送的参数值(value) |
html:hidden (隐藏字段) (修改数据的JSP,常常会用到)
<html:hidden property="sysId" />
属性 | 说明 |
property(必填) | 传送的参数名称(name) |
value | 传送的参数值(value) |
html:errors 显示系统讯息 (最好要搭配<logic:messagesPresent>使用)
<logic:messagesPresent>
<div class="cms-error-text" >
<html:errors/>
</div>
</logic:messagesPresent>