| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 799 人关注过本帖
标题:急啊!在jsp中 html:multibox标签问题
只看楼主 加入收藏
huluhulu88
Rank: 1
等 级:新手上路
帖 子:118
专家分:0
注 册:2007-5-19
收藏
 问题点数:0 回复次数:0 
急啊!在jsp中 html:multibox标签问题


package com.yourcompany.struts.form;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class CheckboxForm extends ActionForm {
/*
* Generated fields
*/

/** one property */
private String[] ch=new String[0];

/*
* Generated Methods
*/

/**
* Method validate
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
return null;
}

/**
* Method reset
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}

public String[] getCh() {
return ch;
}

public void setCh(String[] ch) {
this.ch = ch;
}

}


<html:form action="/deletePlate">
.......
.....
<logic:present name="adminqueslist">
<logic:iterate id="adminqueslist" name="adminqueslist" >
<tr>
<td width="50" align="center" bgcolor="#FFFFFF">
<html:multibox name="checkboxForm" property="ch"/>
</td>
<td style="font-family: 宋体; font-size: 12px; padding-left:4px" width="76" bgcolor="#FFFFFF" height="25">

<bean:write name="adminqueslist" property="plateName" />

</td>
<td style="font-family: 宋体; font-size: 12px; padding-left:4px" bgcolor="#FFFFFF" height="25">

<bean:write name="adminqueslist" property="plateInstr" />

</td>
</tr>
</logic:iterate>
</logic:present>

</table>
</td>
</tr>
<tr>
<td style="font-family: 宋体; font-size: 12px" height="30">
<html:submit value="删除选定类别"/>
</td>

</tr>
</html:form>

package com.yourcompany.struts.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.ks.hulu.disdaoimpl.DisDaoImpl;

import com.yourcompany.struts.form.CheckboxForm;


public class DeletePlateAction extends Action {

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub

CheckboxForm checkboxForm=new CheckboxForm();

String plateId = request.getParameter("plateId");

String[] selectedItems = new String[0];
selectedItems = checkboxForm.getCh();
for ( int i = 0 ; i < selectedItems.length ; ++i ){
System.out.println( "selected " + i + ": " + selectedItems[i]);
}


return mapping.getInputForward();
}
}


异常:

org.apache.jasper.JasperException: You must specify the value attribute or nested tag content
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

搜索更多相关主题的帖子: multibox jsp html 
2007-08-23 18:28
快速回复:急啊!在jsp中 html:multibox标签问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025284 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved