This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes How to Retrive the hidden field value Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply 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: 14672
    
  11

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: 56192
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to Retrive the hidden field value
 
Similar Threads
how to avoid hedden field value displaying
HTML Hidden value
Getting html form name
JSP values into HTML hidden fields ? or javascript ?
Retrieve the value of a label in JSP