Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [S2] Prepable and Validate

cilquirm

2007-01-17

Replies:



I don't think this will work as you expect it to for 2 reasons :

1) prepare comes before validate ( at least in all the interceptor stacks
that i saw, obviously you're free to change the order )

2) validation, at least in my perusal of the source, doesn't short circuit
the interceptor stack

hth,
-a


André Faria-3 wrote:
>
> All,
>    
>   I have these methods in a Action:
>  
> public action Person extends ActionSupport implemens Preparable {
>   public String input {...}
>   public void prepareInput{..}
>   public void validateSave(){
>     addFieldError("person.name","Error");
>   }
>   public void save(){...};
>   public void prepare(){};
> }
>  
>
>   Before the method input the method prepareInput is called by the
> Interceptor, but the if I put an error in method validateSalve (that is
> called by the interceptor too before the method save), the input result
> will be called, but without call the method prepareInput... Is that
> correct?
>
> Have a Nice Day,
>
> Regards,
> */André Faria/*
> //
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.