struts中用logic:iterate循环遍历每条记录,每条记录前面加上html:multibox
//form中getset方法privatelongcheck[];publiclong[]getCheck(){returncheck;}publicvoidsetCh...
//form中get set方法
private long check[];
public long[] getCheck() {
return check;
}
public void setCheck(long[] check) {
this.check = check;
}
//配置
<form-bean name="goods" type="com.eb.bean.GoodsForm"></form-bean>
<action path="/goods"
type="com.eb.controller.GoodsAction"
name="goods"
scope="request"
parameter="agd">
<forward name="success" path="/background/right/querySuccess.jsp"></forward>
</action>
//action
public ActionForward QueryallGoods(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
GoodsService gs=new GoodsService();
ArrayList<GoodsBean> list=gs.queryallgoods();
request.setAttribute("goods", list);
ActionForward forward = null;
forward = mapping.findForward("success");
return forward;
}
//js页面
<html:form action="/delete.do?agd=DeleteGoods">
<logic:iterate id="good" name="goods" >
<tr><td>
<html:multibox property="check"value="${good.goodsID}"></html:multibox>
</td>
<td><bean:write name="good" property="goodsName"/></td>
<td><bean:write name="good" property="goodsUnit"/></td>
<td><bean:write name="good" property="goodsPrice"/></td>
</tr>
</logic:iterate>
</html:form>
提示:No getter method available for property check for bean under name org.apache.struts.taglib.html.BEAN
求高手帮帮忙,感激 展开
private long check[];
public long[] getCheck() {
return check;
}
public void setCheck(long[] check) {
this.check = check;
}
//配置
<form-bean name="goods" type="com.eb.bean.GoodsForm"></form-bean>
<action path="/goods"
type="com.eb.controller.GoodsAction"
name="goods"
scope="request"
parameter="agd">
<forward name="success" path="/background/right/querySuccess.jsp"></forward>
</action>
//action
public ActionForward QueryallGoods(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
GoodsService gs=new GoodsService();
ArrayList<GoodsBean> list=gs.queryallgoods();
request.setAttribute("goods", list);
ActionForward forward = null;
forward = mapping.findForward("success");
return forward;
}
//js页面
<html:form action="/delete.do?agd=DeleteGoods">
<logic:iterate id="good" name="goods" >
<tr><td>
<html:multibox property="check"value="${good.goodsID}"></html:multibox>
</td>
<td><bean:write name="good" property="goodsName"/></td>
<td><bean:write name="good" property="goodsUnit"/></td>
<td><bean:write name="good" property="goodsPrice"/></td>
</tr>
</logic:iterate>
</html:form>
提示:No getter method available for property check for bean under name org.apache.struts.taglib.html.BEAN
求高手帮帮忙,感激 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询