Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set actionForm initial values from session attributes

 
Sam Sunamin
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Requirements:

I need to populate the initial values from Session attributes using actionForm. Can anyone help me?

For Example, I have a customer whose credit card's number, address, phone number and so on are already stored as session attributes.

Before the customer pay his bill, he may change his credit information. So I used action form to work with action class and the action form should have the initial values from attribute.

Help me, please and thank you in advance.
[ July 18, 2007: Message edited by: Sam Sunamin ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds pretty straightforward to me. Just create an Action class that forwards to the JSP. In that Action class, retrieve the values from the session and put them in the ActionForm. Example:

In the above code, the variable form represents the ActionForm object passed into the execute method as a parameter.
[ July 18, 2007: Message edited by: Merrill Higginson ]
 
Sam Sunamin
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much,Merrill.

I got the idea.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic