日期:2014-05-17  浏览次数:20589 次

求教!想实现上传图片功能,通过String ICP=su.getRequest().getParameter("ICP")无法获取值
我想实现图片上传的功能,但是表单的值一直传递不了,源代码如下(不规范,见谅!):
register.jsp:

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>supplierManagement</title>
</head>

<body>
<form action="register_deal.jsp" method="post" enctype="multipart/form-data" name="form13" id="form13">
  <table width="409">
  <tr>
  <th width="108" scope="col">ICP备案号</th>
  <th width="289" scope="col"><div align="left">
  <input type="text" name="ICP" />
  </div></th>
  </tr>
  <tr>
  <th scope="row">名称</th>
  <td><input type="text" name="name" /></td>
  </tr>
  <tr>
  <th scope="row">公司简介</th>
  <td><textarea name="brief"></textarea></td>
  </tr>
  <tr>
  <th scope="row">供应品</th>
  <td><select name="material">
  <option>蔬菜</option>
  <option>肉类</option>
  </select>
  </td>
  </tr>
  <tr>
  <th scope="row">报价</th>
  <td><input type="text" name="price" /></td>
  </tr>
  <tr>
  <th scope="row">地址</th>
  <td><input type="text" name="address" /></td>
  </tr>
  <tr>
  <th scope="row">电话</th>
  <td><input type="text" name="telephone" /></td>
  </tr>
  <tr>
  <th scope="row">邮箱</th>
  <td><input type="text" name="email" /></td>
  </tr>
  <tr>
  <th scope="row">合格证</th>
  <td><input type="file" name="certification" /></td>
  </tr>
  <tr>
  <th scope="row">检疫合格证</th>
  <td><input type="file" name="certification2" /></td>
  </tr>
  <tr>
  <th scope="row"><input type="submit" name="Submit3" value="提交" /></th>
  <td><div align="center">
  <input type="reset" name="Submit4" value="重置" />
  </div></td>
  </tr>
  </table>
</form>
</body>
</html>

deal_regist