input有个值 servlet怎么得到新输入的值
input里原本有个值,但是我想在servlet里得到自己输入的值,该怎么写?每次传过去的都是原来那个值,困惑呀……jsp中:<formaction="AddServle...
input里原本有个值,但是我想在servlet里得到自己输入的值,该怎么写?每次传过去的都是原来那个值,困惑呀……
jsp中:
<form action="AddServlet" method="post">
.........
<input id="bookcounts" type="text" name="bookcounts" value=<%=count %>>
<a href="/buyCart/AddServlet?bookcounts=<%=count %>&bookID=<%=book.getBookID() %>">
<img alt="sure" src="images/queding.gif"></a>
</td>
.............
</form>
servl中:
int val = Integer.parseInt(request.getParameter("bookcounts")); 展开
jsp中:
<form action="AddServlet" method="post">
.........
<input id="bookcounts" type="text" name="bookcounts" value=<%=count %>>
<a href="/buyCart/AddServlet?bookcounts=<%=count %>&bookID=<%=book.getBookID() %>">
<img alt="sure" src="images/queding.gif"></a>
</td>
.............
</form>
servl中:
int val = Integer.parseInt(request.getParameter("bookcounts")); 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询