• 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

Populating text box from values in Action class

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ranchers,
I have some values stored in session variables in my Action class.

And as i am forwarded to a JSP Page i would like those values to be displayed in the text box on the page.

<bean:write name="...." /> is an alternative. But how to display the values inside the text box.

Pls do reply.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The solution is to write a JavaBean class that extends ActionForm and associate that form to the Action mappping in your struts-config file. In your Action class, you would then populate the property of this bean with the value you want displayed in the text box. you would then use the Struts custom tag <html:text> to display the text box with the value.

If you don't understand the relationship between a Struts Action, an ActionForm, and a JSP that uses <html:xxx> tags, I'd suggest you take a moment to do one of the tutorials in this link.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic