File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts2 ActionContext and Response for chaining actions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 ActionContext and Response for chaining actions" Watch "Struts2 ActionContext and Response for chaining actions" New topic

Struts2 ActionContext and Response for chaining actions

wenbin liu

Joined: May 29, 2010
Posts: 2
I have a pretty complex problem about struts2 chaining actions, thanks in advance for your patience reading my problem. I will try my best to describe it clearly.

Below is my struts.xml:

My logic is like this: When accessing to /myapp/test, TestAction1 will handle the request; In TestAction1, I "include" action x (my 2nd action in my config) like this:

And the important thing is I am using a customized ResponseIml when including "x.action".

After including, I return "success", so the result chains to action y (3rd action in my config);
And at last, TestAction2 continue to handle the request, it will go to success result, and the jsp should be rendered, but what I see is a blank page.

The jsp file is very simple: index.jsp

My question/puzzle is:

  • In TestAction1, if I get the response from ServletActionContext, I am getting different ones before and after including; before including is the default response, but after including I got an instance of my customized ResponseImpl; I expect to get the same one: i.e.: the default response;

  • In TestAction2, I get response from ServletActionContext, what I got is the instance of my customized ResponseIml;

  • I am getting a different ActionContext in TestAction2 (compared with the ActionContext I get in TestAction1).

  • This problem really drive me on the nuts, I have spent days on it.
    Any advice will be appreciated!
    Thanks a million!!

    My Code:


    Please let me know if you need more info, thanks!!
    I agree. Here's the link:
    subject: Struts2 ActionContext and Response for chaining actions
    It's not a secret anymore!