java.lang.NumberFormatException: null
<body>
<div id="container">
<div id="header">
<a id="quit" href="QuitServlet">退出</a>
<h1>宠物医院</h1>
<ul id="menu">
<li><a href="vetsearch.jsp">医生管理</a></li>
<li><a href="customersearch.jsp">客户管理</a></li>
</ul>
</div><!-- -->
<div id="content">
<form action="PetServlet?id=${requestScope.id}" method="post" enctype="multipart/form-data">
<table>
<tr><td><input type="text" value="${requestScope.id}" name="cusId"/></td></tr>
<tr>
<td>主人姓名</td>
<td><input type="text" name="customerName" value="${requestScope.name}"></td>
</tr>
<tr>
<td>宠物姓名</td>
<td><input type="text" name="petName"></td>
</tr>
<tr>
<td>出生日期</td>
<td><input type="text" name="petBirthday"></td>
</tr>
<tr>
<td>宠物照片</td>
<td><input id="title" name="photo" value="" type="file"></td>
</tr>
<td><input type="submit" value="添加" /> </td>
<td><input type="reset" value="重置"/></td>
</table>
</form>
<%-- TODO: --%>
</div>
<div id="footer"></div>
</div>
</body>
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String ii=request.getParameter("id");
System.out.print(2);
System.out.print(ii);
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=GBK");
SmartUpload su = new SmartUpload();
//初始化
su.initialize(this.getServletConfig(), request, response);
//上传过程
try {
su.upload();
} catch (ServletException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SmartUploadException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//获取上传文件对象
Files fs = su.getFiles();
File f = fs.getFile(0);
//获取上传的文件名
String fname = f.getFileName();
try {
su.save("/images");
} catch (ServletException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SmartUploadException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//Request reql = su.getRequest();
String ii2=request.getParameter("cusId");
System.out.print(2);
System.out.print(ii2);
Integer custId = Integer.parseInt(request.getParameter("cusId"));
String petName = request.getParameter("petName");
String petBirthday = request.getParameter("petBirthday");
Pet pet=new Pet(1,petName,petBirthday,fname,custId);
PetDAO petDAO=new PetDAO();
try {
petDAO.save(pet);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
request.setAttribute("msg", "添加成功");
request.getRequestDispatcher("customerdetail.jsp").forward(request, response);
//
// TODO:
//
}
为什么servlet中拿不到id,jsp发送过来的id接收不到