| Author |
Struts 2 - prepopulating a hidden field
|
John Eric Hamacher
Ranch Hand
Joined: Apr 25, 2007
Posts: 230
|
|
Hello: I have a JSP page (page.jsp) which is called from another application. The other application passes in query string (page.jsp?setting=123). I want a hidden field on page.jsp to be prepopulated with the value of setting. I have the following line in page.jsp: <s:hidden name="param_1" /> which a want to be prepopulated with the value of setting. The tag does not accept a value attribute. How can this be done? Thanks eric
|
 |
K Fleischer
Greenhorn
Joined: Jun 25, 2008
Posts: 5
|
|
Instead of calling the jsp directly, you should call a struts action. The action bean can than hold the parameter and you can set the hidden field by a simple [ June 26, 2008: Message edited by: K Fleischer ]
|
 |
John Eric Hamacher
Ranch Hand
Joined: Apr 25, 2007
Posts: 230
|
|
|
Thanks, I'll try that
|
 |
Arun Ak
Greenhorn
Joined: Jun 21, 2009
Posts: 21
|
|
<s:hidden name="hiddenname" key="bar" />
ex.
if bar = "testme"
then
hiddenname=testme
|
 |
nillesh patil
Greenhorn
Joined: Apr 05, 2011
Posts: 1
|
|
K Fleischer wrote:Instead of calling the jsp directly, you should call a struts action. The action bean can than hold the parameter and you can set the hidden field by a simple
[ June 26, 2008: Message edited by: K Fleischer ]
It works thanks buddy !!!
|
 |
 |
|
|
subject: Struts 2 - prepopulating a hidden field
|
|
|