Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Retrive the hidden field value

 
Gadi Reddy
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<input type="hidden" name="eid" value="<%=form.getEventId()%>">

use => request.getParameter("eid");
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It can be read like any other input parameters. For example using EL's "param" or "paramValues" implicit objects, or jsp "request" object.
 
Allen Williams
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64972
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic