First to share the resources found at that time (10 jquery Ajax File Upload Plug-ins, some plug-ins business will charge, pay attention to copyright): http://superdit.com/2010/06/29/10-jquery-ajax-file-uploader-plugins/
At that time their own needs is to upload multiple pictures and other form input data, after the trial of each plug-in finally selected the tenth plug-in is Jqupload:http://jqframework.com/jqupload
The data type for form form submission is: Multipart/form-data, there are several solutions to the form's data that cannot be obtained directly through GetParameter () in the servlet:
A.multipartrequest class: Http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartRequest.html use method reference: http:/ /hi.baidu.com/%b3%ac%bc%b6%ce%de%b5%d0xiaoq/blog/item/d66b9aa3ae073781471064e9.html/cmtid/ a78728f8ea497f9a59ee908b
B.smartupload class: Use the method reference http://tech.ddvip.com/2008-12/122853517497938.html and http://www.iteye.com/topic/255010
C.struts can be processed automatically (not tried)
Finally, choose to use smartupload for implementation.
::::: To be accustomed to using Google search English resources to solve their own problems.
Front-end upload form and JS in the Jqupload download has a simple code to achieve, simply add the form element as required.
The code in the servlet is referenced as follows:
Smartupload mysmartupload = new Smartupload ();
Mysmartupload.initialize (Getservletconfig (), request,response);
try {
Mysmartupload.upload ();
catch (Smartuploadexception e) {
TODO auto-generated Catch block
E.printstacktrace ();
}
Request req = Mysmartupload.getrequest ();
for (int i = 0; i < Mysmartupload.getfiles (). GetCount (); i++) {
Com.jspsmart.upload.File File = Mysmartupload.getfiles (). GetFile (i);
if (file.ismissing ()) continue;
try {
File.saveas ("z://uploadtemp//" + file.getfilename ());
catch (Smartuploadexception e) {
TODO auto-generated Catch block
E.printstacktrace ();
}
}