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 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 Murach's Java Servlets and JSP this week in the Servlets 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: 226

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading data from browser other then getParameter()?
 
Similar Threads
Difference between getParameter() and getAttribute()
applet to servlet
Reg : getting Values from applet using jsp
How to display values in my form if I have two textboxes of same name...
null value in request