Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.1.0
-
None
-
Patch
Description
I'm in edge struts 2 (2.1.1-SNAPSHOT), so I'm not sure if this is a problem in 2.0.11.
When using codebehind, I expected that if a parent class has a @Result annotation with a given name, and a child class has a Result annotation with the same name, that the child annotation would "override" any parent results of the same name. This would seem like expected inheritence behavior (at least to me). It appears that annotations are being taken in the opposite order (parent overrides child setting).
example:
@Result(name="input", value="parent.action")
parentClass
@Result(name="input", value="chlid.action")
childClass extends parentClass
currently the childClass will go to /parent.action, instead of child.action
Looking through the code, it looks like when the ResultMap is being created, it loops from the current class to the superclass, each time overwriting with parent class results. Is this something intended, or can it be changed to work in reverse? The change is simple - just do a check if the entry already exists in the map before inserting.