jQuery in Action, 3rd edition
The moose likes JSP and the fly likes How to Retrive the hidden field value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to Retrive the hidden field value" Watch "How to Retrive the hidden field value" New topic

How to Retrive the hidden field value

Gadi Reddy

Joined: Jan 10, 2006
Posts: 21
Hi Guys,
Here i am post my problem,
can you guys help me.
How to retrive the hidden field value.
in one JSP page i put code like this.
<input type="hidden" name="eid" value="<%=form.getEventId()%>">

i need to get that value into some other JSP page.
How i will get it. i mean i will retrive the hidden field values.
1). is there any other techinque.

it's urgent.please
GS Chidam
Ranch Hand

Joined: Jul 07, 2006
Posts: 34
<input type="hidden" name="eid" value="<%=form.getEventId()%>">

use => request.getParameter("eid");
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

It can be read like any other input parameters. For example using EL's "param" or "paramValues" implicit objects, or jsp "request" object.

[My Blog]
All roads lead to JavaRanch
Allen Williams
Ranch Hand

Joined: Sep 04, 2006
Posts: 136
Hey, I'm sort of new to this, so this may be stupid, or obvious, but you say you need to use it in other JSP pages. I think that means you need to consider the scope, and I think if you put it in request scope and then the browser requests another page, you will not be able to access it.

One of you gurus jump in: true or no?

-------<br />Thanks & regards,<br />anw
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
I believe that using hidden fields to maintain state is a bad idea. It puts a big security hole in your application.

In my previous work place, we contracted a testing company to do some security vulnerablity testing for us. The tester put our application in an unexpected state just by fiddling with the hidden fields. We then spent couple of weeks removing all hidden fields from our JSP forms.

MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

I do not think the OP said anything about using it to maintain state.

And submission parameters have nothing to do with the scopes which hold scoped variables, not request parameters.

Let's not needlessly complicate matters.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: How to Retrive the hidden field value
It's not a secret anymore!