Hi, I have an action that has an object of type "User" as a property. I have a jsp that has a form with several fields, each one targets a property of this User object. How can I use annotations to validate these fields?
public class User { private String name; private String email; // getters and setters... } public class MyAction extends ActionSupport { private User user = new User(); public User getUser() { return this.user; } } With the xml solution I would have: <field name="user.name"> <field-validator type="requiredstring"> <message key="errors.required.name"/> </field-validator> </field> <field name="user.email"> <field-validator type="email"> <message key="errors.required.email"/> </field-validator> </field> How can I use annotations to accomplish the same thing? For simple properties I just do something like this before the setter method: @RequiredStringValidator(message = "Please enter your name", trim = true) cheers -- Filipe David Manana, [EMAIL PROTECTED] Obvious facts are like secrets to those not trained to see them. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]