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

来源:互联网 发布:android 打开淘宝 编辑:程序博客网 时间:2024/05/17 07:00

平时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无法自动选择该值

0 0
原创粉丝点击