This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am having a form that contains <s:select list='persons' name='selectedPerson'.... where persons is a collection of objects of type 'Person' (Id, name, address etc) and it's taken from the database. I want to use validate() to validate the selectedPerson. However if validate() says that it's not ok (by using addFieldError("selectedPerson","required field")), I noticed that the collection "persons" becomes empty. However this is not the case for the values written in textfields & other "simple" stuff.
I don't want to repopulate the list in validate() because I'll be making unnecesary SQL querys to the database.