• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Populating text box from values in Action class

 
Shailesh Pillai
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • 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.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic