思路:
1.上传图片跟商品编号一样
1)创建upload文件夹,保存上传的图片
2)从tomcat处,查找该文件夹的路径为如下路径,并更新反编译后,写入到FileUploadServlet上传文件类里面:
private String uploadPath = "D:\\MyEclipse2014--wm\\workspacewm\\.metadata\\.me_tcat7\\webapps\\drp4.0\\upload";
3)查询的时候:
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Item item=(Item)request.getAttribute("item");
%>
<head>
<base href="<%=basePath %>">
</head>
<img src="upload/<%=item.getItemNO() %>.gif" width="85" height="49">