my dog learned polymorphism*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to Retrive the hidden field value" Watch "How to Retrive the hidden field value" New topic
Author

How to Retrive the hidden field value

Gadi Reddy
Greenhorn

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
Regards,
Raghu.
GS Chidam
Ranch Hand

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

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

Joined: Nov 24, 2005
Posts: 14687
    
  16

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
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Retrive the hidden field value
 
Similar Threads
how to avoid hedden field value displaying
HTML Hidden value
Getting html form name
Retrieve the value of a label in JSP
JSP values into HTML hidden fields ? or javascript ?