struts1中使用<html:select>标签的的三种情况的传值问题

平时struts1中常使用①

<html:select property="typeIDS">
          <html:options collection="Types" property="value"  labelProperty="label" />
</html:select>

也有时使用②

<html:select property="benefitMarkS">
         <html:option value=""></html:option>
         <html:option value="1">是</html:option>
         <html:option value="2">否</html:option>
</html:select>

方式

而有时候使用③

<html:select property="benefitMarkS">
         <option value=""></option>
         <option value="1">是</option>
         <option value="2">否</option>
</html:select>

 

当我们做一个页面中包含:1上半部是查询条件部分,2下半部分是一个列表用来显示查询结果

用户选择查询条件后点击查询,跳转到服务器查询数据并返回该页面显示数据

当查询部分分别加入①②③三种形式的select控件时

且action不对actionfrom进行处理

当跳转回页面显示数据时,①②两种情况可以将跳转到服务器查询之前的查询条件带回页面并自动选择该值

当使用③的形式时,值也将被带回页面,但struts无法自动选择该值

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值