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

doPost how to get parameters ?

 
Milan Djukic
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have form for upload a picture and 2 input tags.
How to get parameters? request.getParameter("") not working - allways null

But in doGet all is OK. How to solve this?
 
Valery Lezhebokov
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should work. What the getParameterMap() method returns?
 
Milan Djukic
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i write System.out.println(request.getParameterMap()) i get "{}".

 
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
getParameter() (and its ilk) does not work when you are using a multi-part form. (I assume you are not using Servlets 3.)

Are you using a file upload package? If so, the documentation for that package should tell you how to get the non-file parameter values. If not, well you should be. File uploading and multi-part forms are too complex to go about re-inventing the wheel.

 
Milan Djukic
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'r right. I use org.apache.commom.fileupload and multi-part form

Can you tell me how to get parameters i dont have much time to read documentation
 
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
But I have time to read it to you?
 
Milan Djukic
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, i didnt say to read, but if you know from experience with commons.
 
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
I haven't used it in years. I'd have to look it up just like you.
 
Stefan Evans
Bartender
Posts: 1691
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't have enough time to even google using apache file upload, find the first link and read the section entitled "Processing the uploaded items", then what are you doing wasting time waiting on this forum?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic