• 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

Another JSP Question (populating HTML fields from beans)

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I have it so the value I want prints out here:

<bean:write name="contact" property="firstName" />

how would I go about, one line later, putting that value where I marked HERE

<html:hidden property="person.firstName" value= HERE/>

Is there a way? Or is this, too more a Struts question?
I've looked at PageContext.getAttribute(), but even if I cast the attribute value into an appropriate type I set up inside of a scriplet, and use the right getter of that type to assign the value I want into a reference, can I then put that reference variable into an HTML field somehow?

Just point me in the right direction, if you can... Thanks!
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Neel,
The Struts approach would be to put contact.firstName in your ActionForm from within your Action. That way it would be available when you render the html:hidden value.

And yes, this is a Struts specific question so I'll move it to our Struts specific forum.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic