Did you either set your appInterceptors stack to be the default stack, or
define the actions you're testing with to use the appInterceptors stack
explicitly?  Otherwise, you're actually just using the defaultStack.
  (*Chris*)

On Mon, Nov 16, 2009 at 12:34 PM, Oscar <oscar.kalde...@gmail.com> wrote:

> Hi to all. I'm developing a Struts 2 application and i create an
> interceptor to initialize values and to validate user login. I want to load
> a list to jsp to populate a s:select so i implemented the Preparable
> interface in my action, and the method prepare(), so i type the code in this
> method to get the list from DB. For that i supposed that my custom
> interceptor will execute before the prepare method because in my interceptor
> i initialize my connection that i use on prepare(), but perpare() executes
> before that, so it gives me a NullPointerException.
>
> Then i googled about it and i found something about PrepareInterceptor, so
> i defined in my interceptor stack after my own interceptor, like this:
>
> <interceptor-stack name="appInteceptors">
> <interceptor-ref name="initializeInterceptor" />
>               <interceptor-ref name="prepare" />
>               <!--<interceptor-ref name="permissionsInterceptor" />-->
>               <interceptor-ref name="defaultStack" />
> </interceptor-stack>
>
> But it doesn't work, because i tought that with the order change my
> interceptor will execute before than action's prepare() method, but don't.
>
> Somebody knows how to execute prepare() after a custom interceptor
> execution?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to