Recently I've upgraded our struts2 framework and its related plugins (in particular, the json plugin) from version 2.1.8 to version 126.96.36.199.
Now I'm having problems in using the json plugin while making json requests and returning the json responses.
The problem is that the parameter values passed in the json request are not set on my struts 2 action any more (likewise, the return fields set in my action are not returned as a json string).
Why does this happen? The problem is that a change has been made in the newer version of json plugin regarding to how the target action is found.
1. Consider this method:
from the older version of the json plugin (2.1.8):
It is not clear to me why the logic of finding the target action has changed to popping up the value from the top of the stack.
In our case this approach does not work anymore, since we have a custom interceptor pushed onto the top of the stack.
Is there any official workaround? Any explanation why this has changed?
For the moment, the only workaround I've found is specifying the 'root' attribute (with 'action' value) both on the json interceptor and each of the json results. But I'm not sure if it's the right approach.
Welcome to the JavaRanch
I don't know of anyone here who would have that kind of insight into the design decisions of the Struts developers. You may be able to get some insight from searching the Struts 2 Issue Tracker, where the devs track all proposed changes and the developer mailing list, where the devs discuss how to fix said issues. I don't know how receptive the dev list is to questions about design decisions.