初学者请教高手:关于获取复选框选中的记录信息的问题!急!~~~~ String[] tempDetainTypeArray=request.getParameterValues("复选框名称");这样可以取得一个选中的复选框的值。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String[] str = getRequest().getParameterValues("mm"); 谢谢两位高手的指教,但输出的值是NULL,是什么原因?我的原代码如下:从库中的表t_contact中取得记录,我现在想获得复选框选中的表中的记录的信息,如选中的表中的name字段的值,点击发送按钮后,将此信息加入到另一表中。请各位高手在指点指点,谢谢!<%@ page contentType="text/html;charset=gb2312" %><html><%@ page language="java"%><%@ page import="java.sql.*"%><head><title>V2</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body><jsp:useBean id="work2" scope="page" class="V2.Dbopen"/><% ResultSet rs=work2.executeQuery("select * from t_contact where user_name='wei' order by name");%><form name="form1" method="post"> <table width="75%" border="0" align="center"> <tr> <td> <table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC"> <tr align="center" valign="middle"> <td width="10%"><strong><font size="2" face="宋体">操作</font></strong></td> <td width="15%"><strong><font size="2" face="宋体">联系人姓名</font></strong></td> <td width="50%"><strong><font size="2" face="宋体">工作单位</font></strong></td> <td width="25%"><strong><font size="2" face="宋体">职务</font></strong></td> </tr> <% while(rs.next()){ %> <tr align="center" valign="middle"> <td width="10%"><input name="sendChoice" type="checkbox" value="checkbox"></td><%String[] tempDetainTypeArray=request.getParameterValues("sendChoice");out.print(tempDetainTypeArray);%> <td width="15%"> <div align="center"> <font size="2" face="宋体"> <% out.print(rs.getString("name"));%></font></div></td> <td width="50%"> <div align="center"> <font size="2" face="宋体"> <%out.print(rs.getString("corp_name"));%></font></div></td> <td width="25%"> <div align="center"> <font size="2" face="宋体"> <%out.print(rs.getString("position"));%></font></div></td> </tr> <% } rs.close();%> </table> <table width="100%" border="0"> <tr> <td><input name="SelectAll" type="checkbox" onClick="Select_All()"> <font size="2" face="宋体"><strong>全选</strong></font> <input type="submit" name="Submit" value="Send"></td> </tr> </table> </td> </tr> </table></form></body></html> 你首先将该条记录的主键(唯一标识)赋给<input name="sendChoice" type="checkbox" value="<%=id%>">的value,然后到下一个页面用<%String[] tempDetainTypeArray=request.getParameterValues("sendChoice");out.print(tempDetainTypeArray);%>来接收用户选中的记录的id,然后将选中的信息插入到别一个表中。 我试了,为什么输出的是[Ljava.lang.String;@b5c22f 。而且@后的字符串刷新后是变化的 快速查找String 字符串的问题?算法高手快进来!!!!!!!!!!!!!!!!!! 求求求求求求求求求求求求求求求求图片放大缩小 各位大侠,谁有基于struts从数据库里下载附件的例子?小弟快被搞死了 java中怎样处理事物啊? 用resin来做服务器还需不需要加上apache 求Professional JSP 2nd Edition 的代码。 十万火急string问题 请问在weblogic中怎样配置才能使用javabeans?谢谢! JSP+ORACLE9I的问题 [JavaBean] 路径问题 jsp好在哪里呢??我认为好像不如asp 端口号隐藏????
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<%@ page language="java"%>
<%@ page import="java.sql.*"%>
<head>
<title>V2</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<jsp:useBean id="work2" scope="page" class="V2.Dbopen"/>
<%
ResultSet rs=work2.executeQuery("select * from t_contact where user_name='wei' order by name");
%>
<form name="form1" method="post">
<table width="75%" border="0" align="center">
<tr>
<td>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
<tr align="center" valign="middle">
<td width="10%"><strong><font size="2" face="宋体">操作</font></strong></td>
<td width="15%"><strong><font size="2" face="宋体">联系人姓名</font></strong></td>
<td width="50%"><strong><font size="2" face="宋体">工作单位</font></strong></td>
<td width="25%"><strong><font size="2" face="宋体">职务</font></strong></td>
</tr>
<% while(rs.next()){ %>
<tr align="center" valign="middle">
<td width="10%"><input name="sendChoice" type="checkbox" value="checkbox"></td>
<%
String[] tempDetainTypeArray=request.getParameterValues("sendChoice");
out.print(tempDetainTypeArray);
%>
<td width="15%"> <div align="center"> <font size="2" face="宋体">
<% out.print(rs.getString("name"));%></font></div></td>
<td width="50%"> <div align="center"> <font size="2" face="宋体">
<%out.print(rs.getString("corp_name"));%></font></div></td>
<td width="25%"> <div align="center"> <font size="2" face="宋体">
<%out.print(rs.getString("position"));%></font></div></td>
</tr>
<%
}
rs.close();
%>
</table>
<table width="100%" border="0">
<tr>
<td><input name="SelectAll" type="checkbox" onClick="Select_All()">
<font size="2" face="宋体"><strong>全选</strong></font>
<input type="submit" name="Submit" value="Send"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
<%
String[] tempDetainTypeArray=request.getParameterValues("sendChoice");
out.print(tempDetainTypeArray);
%>
来接收用户选中的记录的id,然后将选中的信息插入到别一个表中。