File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 ActionContext and Response for chaining actions

 
wenbin liu
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
<h1>Test!</h1>




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:

    TestAction1:






    Please let me know if you need more info, thanks!!
     
    I agree. Here's the link: http://aspose.com/file-tools
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic