我的表单信息:
<form method = "post" name ="AddGoodsChuli" action="AddGoodsChuli.jsp">
<table>
<tr>
<td align="right">商名编号</td>
<td><input type = "text" name = "Goods_ID"></td>
<tr>
<td align="right">商品名称</td>
<td><input type = "text" name = "Goods_Name"></td>
<tr>
<td align="right">保质期</td>
<td><input type = "text" name = "Goods_Guarantee "></td>
<tr>
<td align="right"><input type="submit" value="添加"></td>
<td align="center"><input type = "reset" value = "重置"> </td>
</table>
</form>
在另一个页面接受时,前两个参数都能接收到,第三个却接收不到,为什么?
<%
//获取参数
String Goods_ID = request.getParameter("Goods_ID");
//System.out.println(Goods_ID);
String Goods_Name = request.getParameter("Goods_Name");
//System.out.println(Goods_Name);
String strGoods_Guarantee = request.getParameter("Goods_Guarantee");
//System.out.println(strGoods_Guarantee);
int Goods_Guarantee = Integer.parseInt(strGoods_Guarantee);
//System.out.println(Goods_Guarantee);
%>
------解决方案--------------------
"Goods_Name">
"Goods_Guarantee ">
是不是空格的原因呢!!!
------解决方案--------------------
空格吧。。。
------解决方案--------------------