it's very simple, just as below: <package name="newpackage" extends="struts-default" namespace="/newpackage"> <interceptors> <interceptor name="paginationSupportInterceptor" class="cn.openmotel.lorenzo.web.struts2.PaginationSupportInterceptor" /> <interceptor-stack name="defaultInterceprotStack"> <interceptor-ref name="checkbox" /> <interceptor-ref name="params" /> <interceptor-ref name="paginationSupportInterceptor" /> <interceptor-ref name="defaultStack" /> </interceptor-stack> </interceptors> <default-interceptor-ref name="defaultInterceprotStack"></default-interceptor-ref> </package>
Thanks! Mobile: +086-15864011231 Website:http://www.openmotel.cn http://www.vvthumb.com GTalk:[EMAIL PROTECTED] Skype:saharabear Haulyn Runner Jason ----- Original Message ---- From: Musachy Barroso <[EMAIL PROTECTED]> To: Struts Users Mailing List <user@struts.apache.org> Sent: Wednesday, October 15, 2008 10:04:51 PM Subject: Re: How to setup Interceptor when using struts2.1.2 rest plugin with codebehind? Can you post the definition of your "newpackage" package? musachy On Wed, Oct 15, 2008 at 9:58 AM, Haulyn Jason <[EMAIL PROTECTED]> wrote: > Hi,all > My application is running on struts2.1.2 with rest plugin and codebehind. > The code is like Struts2.1.2-rest-showcase.war. But when I want to add my > own Interceptors, something broken. > > I add a new package extends "struts-default" and re-defined the > interceptor-stack as below: > > <interceptors> > <interceptor name="paginationSupportInterceptor" > class="cn.openmotel.lorenzo.web.struts2.PaginationSupportInterceptor" /> > <interceptor-stack name="defaultInterceprotStack"> > <interceptor-ref name="checkbox" /> > <interceptor-ref name="params" /> > <interceptor-ref name="paginationSupportInterceptor" /> > <interceptor-ref name="defaultStack" /> > </interceptor-stack> > </interceptors> > <default-interceptor-ref > name="defaultInterceprotStack"></default-interceptor-ref> > > I want my OrdersController run under this package, so I add annotation > @ParentPackage(value="newpackage"). Then something break. > > I debug my application and found the OrdersController worked but struts2 > can not find the result setting. But before I add > @ParentPackage(value="newpackage"), everything works well. > > I defind my Result as > @Results({ > @Result(name="success", type=ServletActionRedirectResult.class, > value="website/orders") > }) > > I spent two days on this but it didn't work anymore. I found two > Interceptors in the REST plugin, did I lose something? > > Thanks! > > > Mobile: +086-15864011231 > Website:http://www.openmotel.cn > http://www.vvthumb.com > GTalk:[EMAIL PROTECTED] <[EMAIL PROTECTED]> > Skype:saharabear > > > > > Haulyn Runner Jason > > > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd