锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久综合五月,日韩一二三四区,中文字幕网站视频在线
http://www.aygfsteel.com/liangj/category/30378.htmlzh-cnWed, 26 Mar 2008 03:05:59 GMTWed, 26 Mar 2008 03:05:59 GMT60瑙e喅褰揊ORM鐨凟NCTYPE="multipart/form-data" 鏃秗equest.getParameter()鑾峰彇涓嶅埌鍊肩殑鏂規硶http://www.aygfsteel.com/liangj/archive/2008/03/26/188666.html姊佸仴姊佸仴Wed, 26 Mar 2008 02:38:00 GMThttp://www.aygfsteel.com/liangj/archive/2008/03/26/188666.htmlhttp://www.aygfsteel.com/liangj/comments/188666.htmlhttp://www.aygfsteel.com/liangj/archive/2008/03/26/188666.html#Feedback0http://www.aygfsteel.com/liangj/comments/commentRss/188666.htmlhttp://www.aygfsteel.com/liangj/services/trackbacks/188666.htmlSituation(鍘熷洜):
javax.servlet.HttpServletRequest.getParameter(String) returns null when the ContentType is multipart/form-data
Solutions(瑙e喅鍔炴硶):
Solution A:
1. download http://www.servlets.com/cos/index.html
2. invoke getParameters() on com.oreilly.servlet.MultipartRequest
Solution B:
1. download http://jakarta.apache.org/commons/fileupload/
2. invoke readHeaders() in
org.apache.commons.fileupload.MultipartStream
Or
1. Invoke parseRequest(request) on org.apache.commons.fileupload.FileUploadBase which returns list of org.apache.commons.fileupload.FileItem objects.
2. Invoke isFormField() on each of the FileItem objects. This determines whether the file item is a form paramater or stream of uploaded file.
3. Invoke getFieldName() to get parameter name and getString() to get parameter value on FileItem if it's a form parameter. Invoke write(java.io.File) on FileItem to save the uploaded file stream to a file if the FileItem is not a form parameter.
Solution C:
1. download http://users.boone.net/wbrameld/multipartformdata/
2. invoke getParameter on
com.bigfoot.bugar.servlet.http.MultipartFormData
Solution D:
Use Struts. Struts 1.1 handles this automatically.