• 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

ActionForm composition

 
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just wonder if it's to create a form bean with a composition. Assuming I have the following classes:
AccountInformation ( fname, lname...)
CreditCard (number, type...)

I would like to know if it possible to create a form (registration) that is composed of AccountInformation and CreditCard???

I don't want to retype all properties again (doesn't sound right)

my question is this:
1. is it possible to do that?
2. if yes, how would the registration.jsp page will look like?

If it was a regular form, it would have been:


I would like too change the property to somthing like this:
<html:text property="creditCard.ccNumber"> (that of course, doesn't work)

thanks for any advise.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<html:text property="creditCard.ccNumber"> (that of course, doesn't work)



That does work if you've set up your ActionForm bean properly. Example:


If you code your Actionform like this, the above <html:text> tag will work as long as the CreditCard class has a ccNumber property.
[ October 24, 2006: Message edited by: Merrill Higginson ]
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
cool, I 'forgot' to instantiated it (my intuitive semi worked)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic