This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes doPost how to get parameters ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "doPost how to get parameters ?" Watch "doPost how to get parameters ?" New topic
Author

doPost how to get parameters ?

Milan Djukic
Greenhorn

Joined: Feb 14, 2011
Posts: 27
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

Joined: Jun 12, 2006
Posts: 39
It should work. What the getParameterMap() method returns?


SCJP 1.5, OCE EJB 3.x
Milan Djukic
Greenhorn

Joined: Feb 14, 2011
Posts: 27
When i write System.out.println(request.getParameterMap()) i get "{}".

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60773
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Milan Djukic
Greenhorn

Joined: Feb 14, 2011
Posts: 27
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

Joined: Jan 10, 2002
Posts: 60773
    
  65

But I have time to read it to you?
Milan Djukic
Greenhorn

Joined: Feb 14, 2011
Posts: 27
No, i didnt say to read, but if you know from experience with commons.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60773
    
  65

I haven't used it in years. I'd have to look it up just like you.
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
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?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doPost how to get parameters ?
 
Similar Threads
call a html/jsp page from an applet and pass parameters in post method
Issue with large request data using AJAX
How can I configure parameters of my webapp using tomcat admin interface
How to get Servlet Init parameters in EL.
POST method parameters