在线234人
首页
主题表
培训咨询
标签
精华
查搜
注册
登陆
用户
自动登陆
密码
新用户注册
忘记密码?
首页
»
论坛
»
开源项目大家谈
上一主题
初学struts,仿照struts in action 的第一个例子,写了个struts例子,关键是,运行到action后,应该跳转, 不管是success还是failer,总的跳转到对应的succ..
下一主题
我在一个insert.jsp中向数据库中insert一条记录,在insert_do.jsp中request获取记录内容,最后通过一个insert类将该记录insert至oracle数据库中。 发现传..
Go
共有
1
回复 /
1
页
前往下页:
vitofh
悄悄话
发表文章: 1
注册时间: 2007年04月24日 13:38
struts的复选框html:multibox的问题
2007年04月24日 13:40
为什么在页面上html:multibox的取值数组的长度为0;
JSP页面:
Vector vecPart=(Vector)session.getAttribute("partList");
TopicDisp partList=null;
if(vecPart!=null)
{
for(int i=0;i<vecPart.size();i++)
{
partList=(TopicDisp)vecPart.get(i);
%>
<tr bgcolor="#CCFFFF">
<td>
<html:multibox property="selectBox"><%=partList.getId()%></html:multibox><%=partList.getId()%>
</td>
<td><%=partList.getId()%></td>
<td><%=partList.getTitle()%></td>
<td><%=partList.getContent()%></td>
</tr>
<%
}
}
FORM页面:
private String[] selectBox=new String[0];
public String[] getSelectBox()
{
return selectBox;
}
public void setSelectBox(String[] selectBox)
{
this.selectBox = selectBox;
}
public void reset(ActionMapping mapping,HttpServletRequest request)
{
this.selectBox=new String[0];
}
ACTION部分为:
SaveRecrodForm sForm=new SaveRecrodForm();
String[] sId=sForm.getSelectBox();
System.out.println("sId.length="+sId.length);
for(int i=0;i<sId.length;i++)
System.out.println(sId
);
banq
悄悄话
发表文章: 9613
注册时间: 2002年08月03日 17:08
回复:struts的复选框html:multibox的问题
2007年04月24日 17:53
<html:multibox property="selectBox"><%=partList.getId()%></html:multibox><%=partList.getId()%>
必须全部使用
Struts
标签,不要自己加入Java语句,ActionForm中需要两个值:一个是多个字符串,一个是multibox选中的缺省值。
共有
1
回复 /
1
页
Go
上一主题
返回本主题
返回主题列表
返回页首
下一主题
热点TAG:
正在读取,请等待...
Wowzio
grab this
·
technology
blog
查询本论坛内
近一天
近三天
近一周
近一月
近三月
近半年
近一年
所有
回复超过
的热门帖子
标题
内容
提交时自动拷贝以上内容到剪贴板 Ctrl-V可取出;提问题前先查询
标签列表
解惑之道在
J道
,打造中国最具影响力的的企业软件社区
推荐Chrome快速浏览本站
OpenSource
JIVEJDON
v3.5
Powered by
JdonFramework
Code © 2002-09
jdon.com
anti spam