File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Reading data from browser other then getParameter()? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Reading data from browser other then getParameter()?" Watch "Reading data from browser other then getParameter()?" New topic

Reading data from browser other then getParameter()?

kengyiam Ng

Joined: Aug 28, 2003
Posts: 7
Dear all,
May I know how to read data from a POST request other than using a request.getParameter() method in a JSP page? Any methods will do except using getParameter() in my JSP pages.
Please kindly advise me on this.
Thanks in advance.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

I'm not sure I understand what you are trying to do. Can you give more information?
Krishna Mohan
Ranch Hand

Joined: May 30, 2003
Posts: 44
e = request.getParameterNames();
while (e.hasMoreElements()) {
String key = (String)e.nextElement();
String[] values = request.getParameterValues(key);
out.print(" " + key + " = ");
for(int i = 0; i < values.length; i++) {
out.print(values[i] + " ");

Programming is Fun.
S Chandra Mohan
Ranch Hand

Joined: Oct 19, 2000
Posts: 75
i too feel that request.getParameter() would be simple and easier.
What situation forces u to use other option ?

Have a wonderful day and wish u success<p>S Chandra Mohan<br />
Debashish Chakrabarty
Ranch Hand

Joined: May 14, 2002
Posts: 231

If using getParameter() is prohibited, try putting the requisite variables to be passed in Session/Applicatoion context as attributes. Fetch those attributes on the next JSP.
[ December 24, 2003: Message edited by: Debashish Chakrabarty ]

SCJP2, SCWCD 1.4, PMP, ITIL Foundation
I agree. Here's the link:
subject: Reading data from browser other then getParameter()?
jQuery in Action, 3rd edition