• 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

Problem on Struts 2 Custom converter registration for Collections

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a bean called Person with properties firstName of type String, lastName of type String and dob of the type java.util.Date with their setter and getter methods.

My action class is named TransactionAction and it extends ActionSupport. In my action class, I declare a Collection named "persons" with its getter and setter methods. I also have an execute() method that returns SUCCESS.

I want to allow a user to enter a date in dd-MM-yyyy format. I have already written a converter for it, registered the converter in my TransactionAction-conversion.properties file and it works fine for a single object.

My question is: How do I register the above converter for the date field of every Person object in a collection of persons? Please note that the collection contains many objects of type Person. I want to use the converter for the date field of each object in the collection.

Thanks & Regards,
John Smith.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic