Re: Manually Checking Validation Errors on an Action

2009-06-11 Thread Steven Hansen
Er... The "validation" interceptor? Yeah, you're right, duh! I didn't realize that the validation interceptor is actually the AnnotationValidationInterceptor class :-P - To unsubscribe, e-mail: user-unsubscr...@struts.ap

Re: Manually Checking Validation Errors on an Action

2009-06-11 Thread Dave Newton
Steven Hansen wrote: Are you sure that calling super.validate() from my action's implementation of validate() will invoke the XML/annotation validations? Hmm, I guess it just does the XML/annotation validation automatically without the super. Too late to change it in the book. Oh well... Kinda

Re: Manually Checking Validation Errors on an Action

2009-06-11 Thread Steven Hansen
Are you sure that calling super.validate() from my action's implementation of validate() will invoke the XML/annotation validations? I'm extending ActionSupport, so super.validate() would call ActionsSupport's validate(), which is just an empty method .. But I think you understand what

Re: Manually Checking Validation Errors on an Action

2009-06-11 Thread Dave Newton
Steven Hansen wrote: Is there anyway to manually check possible validation errors on this action as if it were called by the Validation interceptor? The previous answer was partially correct, depending on what you're actually trying to do. If you implement a validate() method you can call sup

Re: Manually Checking Validation Errors on an Action

2009-06-11 Thread Bhaarat Sharma
you just have to write the validate method public void validate () { if (getModel().something()==null) addFieldError("question", "Something went wrong"); } On Thu, Jun 11, 2009 at 7:15 PM, Steven Hansen wrote: > > Hi, > > I'm trying to test some basic validations on an action: > > > pu

Manually Checking Validation Errors on an Action

2009-06-11 Thread Steven Hansen
Hi, I'm trying to test some basic validations on an action: public class CreateUserAction extends ActionSupport implements ModelDriven { private User user = new User(); private IUserDao userService = new UserDao(); public String execute() { if ( this.userService.save