Reputation: 2740
In Struts2
Keeping these things in mind, I believed that
I found following line of code in book "Manning Struts2 in Action" while creating a custom result class.
ServletActionContext.getResponse()
I am confused why author did not get response using actionInvocation object i.e.
actionInvocation.getInvocationContext().get(StrutsStatics.HTTP_RESPONSE);
Now I have following questions in my mind.
Upvotes: 0
Views: 1136
Reputation: 160251
Contexts use ThreadLocal
s.
Results are clearly instantiated per-request--look at something simple, like StreamResult
: it uses instance variables for things like contentType
and so on.
Upvotes: 3