On 5/16/2018 11:51 PM, Prasanth wrote:
> Would struts2 call this setRequest method even if the class is implementing 
> just ServletRequestAware?

No. Additionally Struts RequestAware method signature is
setRequest(Map<String,Object> request); i.e. it's parameter is Map not
ServletRequest.

> Any insights as to why this additional setRequest method causes the problem? 

Yes. It's same as your issue with username/password copy from previous
action. Your previous action is in value stack (I don't know why! see
[1]) ChainingInterceptor thinks it's a chain result, so, calls
getRequest on previous action and then calls setRequest on your current
action with returned value (i.e. copies this value from previous action
and overrides your private request field inside your action).

You can fix this also by removing getRequest method which disables
ChainingInterceptor to copies this.

But you may encounter several same issues when you have both setX and
getX methods on your actions.

[1] So, as I mentioned before, could you please rewrite all of your
FORWARDs with Struts ServletRedirect or PostBack results (also revert
back all removed getter methods)? this shows us if FORWARDs are root
cause of these issues or not. Then we can investigate more on other
possible causes.

Regards.

Reply via email to