• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hidden Field

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<html:hidden property="dispatch" value="author"/>
works well because "author" is expected literally as
the value of a property called "dispatch".
I also want to pass
String username = request.getRemoteUser();
as the value of a property called "keyValue".
But, either
<html:hidden property="keyValue" value="username"/>
or
<html:hidden property="keyValue" value=username/>
gives me problems. What is the proper way of doing it?
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
If you set the username as an attribute of the request object,
eg: request.setAttribute("username",username)
you can do the following :
<html:hidden property="keyValue" value='<%=request.getAttribute("username")%>'/>
or you can include the username variable in the form bean which is associated to the page, so that u dont need to specify explicitly the value property of html:hidden tag
rgds
beN
 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have username set in the formbean before coming on the page, do this
<html:hidden property="keyValue"/>
This will create a hidden variable with the key="keyValue" and value=formbean.getKeyValue()
HTH
Sahil
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic