aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Reading data from browser other then getParameter()?" Watch "Reading data from browser other then getParameter()?" New topic
Author

Reading data from browser other then getParameter()?

kengyiam Ng
Greenhorn

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
Rancher

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] + " ");
}
out.println();
}


Programming is Fun.
S Chandra Mohan
Ranch Hand

Joined: Oct 19, 2000
Posts: 75
hi
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 />sc_mohan_us@yahoo.com
Debashish Chakrabarty
Ranch Hand

Joined: May 14, 2002
Posts: 230

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 ]

Debashish
SCJP2, SCWCD 1.4, PMP, ITIL Foundation
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Reading data from browser other then getParameter()?