function book_Grounding(){ var isbn=document.getElementById("book_isbn").value; //var b_isbn=parseInt(isbn); document.getElementById("bookISbn").value=isbn; var form1=document.getElementById("form1"); form1.submit(); }
<form action="GroundingServlet" method="post" id="form1"> <input type="hidden" id="bookISbn" name="book_id" ></form>
response.setContentType("text/html"); request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); String book_id=(String)request.getParameter("book_id"); System.out.println("book_id=["+book_id+"]");
输出的值是:book_id=[]
在JSP中好像都没什么问题,测试过好几次,但在servlet就是接收不到值。
1 回答

莫回无
TA贡献1865条经验 获得超7个赞
你这本来就没有值吧,<input type="hidden" id="bookISbn" name="book_id" >没有给book_id值,isbn=document.getElementById("book_isbn").value, isbn就没有值
document.getElementById("bookISbn").value=isbn 再赋值回去,还是没有值啊
添加回答
举报
0/150
提交
取消