求助,servlet怎么不能获得从jsp传来的数据啊!!
在jsp中的代码:
<form action="../uploadImg" method="post" enctype="multipart/form-data" name="form1">
<table>
<tr>
<td align="left">Name:</td>
<td align="left"><input type="text" name="picName"></td>
</tr>
<tr>
<td align="left">Path:</td>
<td align="left"><input type="file" name="picPath"></td>
</tr>
<tr>
<td align="left">Describe:</td>
<td align="left"><textarea rows="5" cols="30" name="picDescribe" ></textarea></td>
</tr>
<tr>
<td align="center"></td>
<td align="center">
<input type="submit" name="bSubmit" id="bSubmit">
<input type="reset" name="bReset" id="bReset">
</td>
</tr>
</table>
</form>
在servlet中的代码:
protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
// TODO Auto-generated method stub
String picName = req.getParameter("picName");
System.out.println(picName);
String picPath = req.getParameter("picPath");
System.out.println(picPath);
String picDescribe = req.getParameter("picDescribe");
}
结果打印出来的值都是null
为什么啊~~~,改了好长时间都没成功!!