请问:checkbox的页面提交的问题,用的request.getParameterValues(),但是取不到值。

zhbz 2004-10-16 05:23:09
//pic.jsp

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td height="134">
<form name="form1" method="post" action="">
<input type="checkbox" name="sys" value="dos" checked>
dos
<input type="checkbox" name="sys" value="windows">
windows delete </a>
</form></td>
</tr>
</table>
</body>
</html>





//deletequantity.jsp

<%@ page contentType="text/html; charset=gb2312"%>
<%@ page language="java" import="java.util.*,java.io.*"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<%

String abc=request.getParameter("sys");
for(int i=0;i<abc.length;i++)
out.print(abc[i]);
%>
</body>
</html>

500 nullpoint 错误。
...全文
568 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
tutor666 2004-10-16
  • 打赏
  • 举报
回复
String[] abc=request.getParameterValues("sys");
在form内需要一个提交按钮
<input type="submit" value="提交"/>
zhbz 2004-10-16
  • 打赏
  • 举报
回复
刚才发错了。少了链接一项。


<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td height="134">
<form name="form1" method="post" action="deletequantity.jsp">
<input type="checkbox" name="sys" value="dos" checked>
dos
<input type="checkbox" name="sys" value="windows">
windows <a href="deletequantity.jsp">delete</a> </a>
</form></td>
</tr>

</table>
</body>
</html>
zhbz 2004-10-16
  • 打赏
  • 举报
回复
大哥好像还是不行呀。
huanghelang 2004-10-16
  • 打赏
  • 举报
回复
<form name="form1" method="post" action="deletequantity.jsp">
Tasia 2004-10-16
  • 打赏
  • 举报
回复
<body>
<%

String[] abc=request.getParameterValues("sys");
for(int i=0;i<abc.length;i++)
out.print(abc[i]);
%>
</body>

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧