You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by blakeb <bl...@gmail.com> on 2008/01/18 06:28:10 UTC

CodeBehind Inherit Parent Actions

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).

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.

Should I log a JIRA issue?
-- 
View this message in context: http://www.nabble.com/CodeBehind-Inherit-Parent-Actions-tp14946931p14946931.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: CodeBehind Inherit Parent Actions

Posted by blakeb <bl...@gmail.com>.
Logged in JIRA as WW-2443


blakeb wrote:
> 
> Sorry, that was in the ClasspathPackageProvider class.
> 
> Thanks for your help.
> Blake
> 
> 
> blakeb wrote:
>> 
>> 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).
>> 
>> 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.
>> 
>> Should I log a JIRA issue?
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/CodeBehind-Inherit-Parent-Actions-tp14946931p14947108.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: CodeBehind Inherit Parent Actions

Posted by blakeb <bl...@gmail.com>.
Sorry, that was in the ClasspathPackageProvider class.

Thanks for your help.
Blake


blakeb wrote:
> 
> 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).
> 
> 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.
> 
> Should I log a JIRA issue?
> 

-- 
View this message in context: http://www.nabble.com/CodeBehind-Inherit-Parent-Actions-tp14946931p14946932.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org