Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting the parameters from multipart/form-data

 
Jim Halpert
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My JSP:

My Servlet:


In the console you will see 'Title: null'
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The getParameter() family of methods will not work with anything other than data encoded as x-www-form-urlencoded.

if you are using a 3rd-party library to assist in the file upload, it will have methods to fetch the parameters. If you are parsing the multi-part request yourself (not recommended!), well, then you need to parse out the parameters yourself.
 
Jim Halpert
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using:
commons-fileupload-1.2.2.jar
&
commons-io-2.0.1.jar

Do you know which method to call so I can get the parameters? (I could not find anything in the API list)

 
olivier dutranoit
Ranch Hand
Posts: 81
IBM DB2 Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
everything is explained very well in here:

http://commons.apache.org/fileupload/using.html
 
Jim Halpert
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
olivier dutranoit wrote:everything is explained very well in here:

http://commons.apache.org/fileupload/using.html


That helped me alot, I got it working!! Thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic