Re: Question about PrepareInterceptor and Preparable
Chris Pratt escribió: 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 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: 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 Well Chris, you're right, i didn't realize that i don't specified my action to use that interceptor stack, i've been specified a default stack for all the package but in some moment i deleted it and i don't see that Thanks and sorry for that. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Question about PrepareInterceptor and Preparable
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 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: > > > > > > > > > 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 > >
Question about PrepareInterceptor and Preparable
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: 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