常用的Struts html-taglib简单说明

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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值