This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Problem on   Struts 2 Custom converter registration for Collections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem on   Struts 2 Custom converter registration for Collections" Watch "Problem on   Struts 2 Custom converter registration for Collections" New topic
Author

Problem on Struts 2 Custom converter registration for Collections

Johnnie Smith
Greenhorn

Joined: May 02, 2012
Posts: 22
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.
 
Consider Paul's rocket mass heater.
 
subject: Problem on Struts 2 Custom converter registration for Collections
 
Similar Threads
A Castor question
Spring 3 form validation
JDBC assessment part #1 complete, feedback appreciated
Struts Date Conversion
Java Reflection