public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("utf-8");//让页面传来的值能在控制台显示为中文不乱码
response.setContentType("text/html;charset=utf-8");//输出到页面上不乱码
PrintWriter out = response.getWriter();
String [] checkVals=request.getParameterValues("doing");//接收为数组
System.out.println("======"+checkVals.length);
for (String doing : checkVals) {
System.out.println("我提交的数据是:"+doing);
}
}
java接收页面复选框checkbox的值
最新推荐文章于 2024-10-06 17:51:34 发布