jsp部分:
<%@ page language="java" pageEncoding="GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>smart_demo03.jsp</title>
</head>
<body>
<h3><font color="red">文件上传的操作---SmartUpload</font></h3>
<form action="<%=path %>/SmartUploadServlet" method="post" ENCTYPE="multipart/form-data">
图片:<input type="file" name="pic"/><br>
<input type="submit" value="上传"/>
</form>
${messages}
</body>