首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

Struts 的复选框有关问题

2012-01-28 
Struts 的复选框问题%inti0%TDalignrightheight35width 15% 服务名(*): /TDTDwidth 85%

Struts 的复选框问题
<%      
    int   i=0;
         
  %>
<TD   align=right   height=35   width= "15% "> 服务名(*): </TD>
<TD   width= "85% ">
<TABLE   cellSpacing= "0 "   cellPadding= "0 "   width= "60% "   border= "0 "   height=50>
  <logic:iterate   id= "serviceItem "   name= "serviceName ">  
        <tr>
        <td   align= "center ">
      <html:multibox   property= "service ">  
  <%
      out.print(i);
      i++;
      %>
                 
</html:multibox>  
<bean:write   name= "serviceItem "/>
  </td>
              </tr>
</logic:iterate>    
通过上面这个功能   我把数据库中服务名相应的显示页面上   提供选择
但是我在选择提交后发觉   选中的服务名   返回ACTION的值是0,1,2   等
下面是运行代码后的页面代码   可以看到value是0   而不是咨询
<td   align= "center ">
  <input   type= "checkbox "   name= "service "   value= "0 ">  
  咨询
    </td>
有什么办法可以将value改变吗?   谢谢了


[解决办法]
<logic:iterate id= "serviceItem " name= "serviceName ">
<tr>
<td align= "center ">
<html:multibox property= "service ">
<bean:write name= "serviceItem "/>

</html:multibox>

</td>
</tr>
</logic:iterate>
试一下

热点排行