• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to set actionForm initial values from session attributes

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much,Merrill.

I got the idea.
 
Heroic work plunger man. Please allow me to introduce you to this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic