• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2 ActionContext and Response for chaining actions

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
     
    reply
      Bookmark Topic Watch Topic
    • New Topic