解决jsp或serverlet 不能解析multipart/form-data 类型的表单域的问题

10/28/2009来源:JSP实例人气:11426

解决jsp或serverlet 不能解析multipart/form-data 类型的表单域的问题
10 6月 2008

Situation:

javax.servlet.HttpServletRequest.getParameter(String) returns null when the ContentType is multipart/form-data

Solutions:

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/sandbox/fileupload/
2. invoke readHeaders() in
org.apache.commons.fileupload.MultipartStream

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.

Solution E:
use jspSmartUpload compounds
http://ckasj.vicp.net/dokuwiki/doku.php/freespace:smart_upload