文件上传组件的应用
2008-04-22 20:28
417 查看
注册页面的逻辑处理bean:doReg.java
其中包括apache上传组件1.2.1的应用
package huc.blog.servlet;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import huc.blog.bean.User;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import huc.blog.op.UserOp;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.io.File;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.io.IOException;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.util.Date;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.text.SimpleDateFormat;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.util.List;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.ServletException;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.http.HttpServlet;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.http.HttpServletRequest;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.http.HttpServletResponse;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.fileupload.FileItem;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.fileupload.FileUploadException;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.fileupload.servlet.ServletFileUpload;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
public class DoReg extends HttpServlet ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/** *//**
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
*
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private static final long serialVersionUID = 1L;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
@Override
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
throws ServletException, IOException ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
doPost(req,resp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
@Override
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
throws ServletException, IOException ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
SimpleDateFormat f=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
User user=new User();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//设置保存上传文件的目录
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String uploadDir=getServletContext().getRealPath("/upload");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(uploadDir==null)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println("该目录无法访问!");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
File fileUploadDir=new File(uploadDir);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(!fileUploadDir.exists())...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(!fileUploadDir.mkdir())...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println("无法创建目录!");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//RequestContext requestContext = new ServletRequestContext(req);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//判断表单中是否为multipart/form-data类型的数据,非则终止
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(!ServletFileUpload.isMultipartContent(req))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println("不能处理非multipart/form-data类型的数据!");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//创建DiskFileItemFactory对象,并进行一些设置
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DiskFileItemFactory factory = new DiskFileItemFactory();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//设置直接能够存储的最大文件量,超出后采用临时文件缓存
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
factory.setSizeThreshold(1024*1024);//以字节为单位
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**//*Sets the directory used to temporarily store files that
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* are larger than the configured size threshold.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* 默认为tomcat的安装目录 emp下
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//factory.setRepository(java.io.File repository);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ServletFileUpload upload = new ServletFileUpload(factory);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//设置最多上传的数据量
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
upload.setSizeMax(1024*1024*10);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/** *//**
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* Specifies the character encoding to be used
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* when reading the headers of individual part.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* When not specified, or null, the request encoding is used.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* If that is also not specified, or null, the platform default encoding is used.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//upload.setHeaderEncoding("UTF-8");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
List<?> items=null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//得到表单字段的集合
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
items = upload.parseRequest(req);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}catch(FileUploadException e)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
e.printStackTrace();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
for(Object item:items)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FileItem fileItem=(FileItem)item;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Determines whether or not a FileItem instance represents a simple form field.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(fileItem.isFormField())...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Returns the contents of the file item as a String, using the specified encoding.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String content=fileItem.getString("UTF-8");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String fieldName=fileItem.getFieldName();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(fieldName.equals("userName"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setUserName(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else if(fieldName.equals("nickName"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setNickName(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else if(fieldName.equals("userPass"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setUserPass(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else if(fieldName.equals("email"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setEmail(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else if(fieldName.equals("city"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setCity(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else if(fieldName.equals("spaceName"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setSpaceName(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Returns the original filename in the client's filesystem,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//as provided by the browser (or other client software).
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String source=fileItem.getName();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//如果没有选择文件,则不进行处理
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(source.trim().equals(""))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
continue;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//得到上传的文件名
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int pos=source.lastIndexOf("/");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String fileName=source.substring(pos+1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
File file=new File(uploadDir,fileName);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//write an uploaded item to disk
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fileItem.write(file);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} catch (Exception e) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
e.printStackTrace();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}finally...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Deletes the underlying(潜在的)storage for a file item,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//including deleting any associated temporary disk file
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fileItem.delete();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Date date=new Date();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setRegDate(f.format(date));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setUpdateTime(f.format(date));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
UserOp userOp=new UserOp();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(!userOp.checkNotExist(user))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String msg="该用户已存在,请重新填写!";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.setAttribute("msg",msg);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.getRequestDispatcher("../reg.jsp").forward(req,resp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(userOp.add(user))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.setAttribute("info", "success");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.getRequestDispatcher("../reginfo.jsp").forward(req, resp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.setAttribute("info","failed");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.getRequestDispatcher("../reginfo.jsp").forward(req, resp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
其中包括apache上传组件1.2.1的应用
package huc.blog.servlet;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import huc.blog.bean.User;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import huc.blog.op.UserOp;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.io.File;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.io.IOException;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.util.Date;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.text.SimpleDateFormat;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.util.List;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.ServletException;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.http.HttpServlet;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.http.HttpServletRequest;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.http.HttpServletResponse;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.fileupload.FileItem;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.fileupload.FileUploadException;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.fileupload.servlet.ServletFileUpload;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
public class DoReg extends HttpServlet ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/** *//**
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
*
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private static final long serialVersionUID = 1L;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
@Override
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
throws ServletException, IOException ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
doPost(req,resp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
@Override
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
throws ServletException, IOException ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
SimpleDateFormat f=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
User user=new User();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//设置保存上传文件的目录
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String uploadDir=getServletContext().getRealPath("/upload");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(uploadDir==null)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println("该目录无法访问!");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
File fileUploadDir=new File(uploadDir);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(!fileUploadDir.exists())...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(!fileUploadDir.mkdir())...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println("无法创建目录!");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//RequestContext requestContext = new ServletRequestContext(req);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//判断表单中是否为multipart/form-data类型的数据,非则终止
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(!ServletFileUpload.isMultipartContent(req))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println("不能处理非multipart/form-data类型的数据!");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//创建DiskFileItemFactory对象,并进行一些设置
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
DiskFileItemFactory factory = new DiskFileItemFactory();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//设置直接能够存储的最大文件量,超出后采用临时文件缓存
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
factory.setSizeThreshold(1024*1024);//以字节为单位
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**//*Sets the directory used to temporarily store files that
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* are larger than the configured size threshold.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* 默认为tomcat的安装目录 emp下
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//factory.setRepository(java.io.File repository);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ServletFileUpload upload = new ServletFileUpload(factory);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//设置最多上传的数据量
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
upload.setSizeMax(1024*1024*10);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/** *//**
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* Specifies the character encoding to be used
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* when reading the headers of individual part.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* When not specified, or null, the request encoding is used.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* If that is also not specified, or null, the platform default encoding is used.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//upload.setHeaderEncoding("UTF-8");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
List<?> items=null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//得到表单字段的集合
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
items = upload.parseRequest(req);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}catch(FileUploadException e)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
e.printStackTrace();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
for(Object item:items)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FileItem fileItem=(FileItem)item;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Determines whether or not a FileItem instance represents a simple form field.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(fileItem.isFormField())...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Returns the contents of the file item as a String, using the specified encoding.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String content=fileItem.getString("UTF-8");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String fieldName=fileItem.getFieldName();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(fieldName.equals("userName"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setUserName(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else if(fieldName.equals("nickName"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setNickName(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else if(fieldName.equals("userPass"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setUserPass(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else if(fieldName.equals("email"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setEmail(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else if(fieldName.equals("city"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setCity(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else if(fieldName.equals("spaceName"))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setSpaceName(content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Returns the original filename in the client's filesystem,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//as provided by the browser (or other client software).
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String source=fileItem.getName();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//如果没有选择文件,则不进行处理
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(source.trim().equals(""))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
continue;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//得到上传的文件名
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int pos=source.lastIndexOf("/");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String fileName=source.substring(pos+1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
File file=new File(uploadDir,fileName);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//write an uploaded item to disk
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fileItem.write(file);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} catch (Exception e) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
e.printStackTrace();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}finally...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Deletes the underlying(潜在的)storage for a file item,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//including deleting any associated temporary disk file
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fileItem.delete();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Date date=new Date();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setRegDate(f.format(date));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
user.setUpdateTime(f.format(date));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
UserOp userOp=new UserOp();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(!userOp.checkNotExist(user))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String msg="该用户已存在,请重新填写!";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.setAttribute("msg",msg);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.getRequestDispatcher("../reg.jsp").forward(req,resp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(userOp.add(user))...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.setAttribute("info", "success");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.getRequestDispatcher("../reginfo.jsp").forward(req, resp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
}else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.setAttribute("info","failed");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
req.getRequestDispatcher("../reginfo.jsp").forward(req, resp);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
相关文章推荐
- Java 文件上传组件 Apache Commons FileUpload 应用指南——FileUpload如何工作?
- Java 文件上传组件 Apache Commons FileUpload 应用指南(二)——FileUpload如何工作?
- Fine Uploader文件上传组件应用介绍
- Java 文件上传组件 Apache Commons FileUpload 应用
- jspSmartUpload--文件上传与下载组件的应用----文件上传、下载、删除
- ASP.NET文件上传控件——WebbUpload我下载了这个组件后做了一些修改并应用了ajax技术
- JSP上传文件的实现,应用jspsmart组件包
- Java 文件上传组件 Apache Commons FileUpload 应用指南(二)——FileUpload如何工作?
- 第1章文件上传组件的应用与编写
- 传智播客Java web学习-文件上传组件的应用
- 文件上传组件的应用与编写
- Java 文件上传组件 Apache Commons FileUpload 应用指南(二)——FileUpload如何工作?
- Java 文件上传组件 Apache Commons FileUpload 应用指南(二)——FileUpload如何工作?
- Java 文件上传组件 Apache Commons FileUpload 应用
- 文件上传组件的应用与编写
- 张孝祥 文件上传组件的应用与编写
- Fine Uploader文件上传组件应用介绍
- Java 文件上传组件 Apache Commons FileUpload 应用指南
- Fine Uploader文件上传组件应用介绍
- eWebEditor文件上传路径的应用