Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

How to setup Interceptor when using struts2.1.2 rest plugin with codebehind?

Haulyn Jason

2008-10-15

Replies: Find Java Web Hosting

Author LoginPost Reply
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:saharabear@(protected)
Skype:saharabear




Haulyn Runner Jason



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