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的值
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.