///1.jsp
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.skgk_dm,">国库
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.zsxm_dm,">税(费)种
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.ysfpbl_dm,">预算级次
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.nsr_swjg_dm,">征管单位
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.zspm_dm,">税(费)目
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.yskm_dm,">预算科目
<input type="checkbox" name="checkbox" value="xfjssq.dbo.sbspk.djzclx_dm,">注册类型</tr>
///2.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%! //Connection conn;Statement st;ResultSet rs;String sql,sql1,sql2,sql3,sql4; %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body background="/img/bgimg.jpg">
<center>银行对帐查询结果</center><hr>
<% String sql;
String check[] = request.getParameterValues("checkbox");
try{
sql="select distinct ";
int i=0;
while(i<7){
sql+=check[i];
i++;
}
out.println(sql);
}catch(Exception e){
e.getStackTrace();
}
%>
</body>
</html>
复选框全选中时正常,但只要有一个不选,语句就不显示,请问为什么谢谢