You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "David Waite (JIRA)" <ji...@apache.org> on 2008/03/20 06:27:00 UTC
[jira] Created: (WW-2559) Result/Results annotations do not
override on subclasses
Result/Results annotations do not override on subclasses
--------------------------------------------------------
Key: WW-2559
URL: https://issues.apache.org/struts/browse/WW-2559
Project: Struts 2
Issue Type: Bug
Affects Versions: 2.0.11.1
Reporter: David Waite
The ClasspathConfigurationProvider's ResultMap scans for Result and Results annotations on the class, going up the inheritance chain. However, this means that any annotations on a parent will write over annotations on the child.
Example:
@Result("/foo.jsp)
public class FooAction {
public String execute {
return "success";
}
}
...
@Result("/bar.jsp")
public class BarAction extends FooAction {
}
the success result will always render foo.jsp, whether you are invoking FooAction or BarAction
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WW-2559) Result/Results annotations do not
override on subclasses
Posted by "David Waite (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Waite updated WW-2559:
----------------------------
Attachment: struts-2.0.11.1-results-annotation-override.patch
Fixes issue within my environment. I do not know the corresponding file in struts 2.1 to check if the same issue exists.
> Result/Results annotations do not override on subclasses
> --------------------------------------------------------
>
> Key: WW-2559
> URL: https://issues.apache.org/struts/browse/WW-2559
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.0.11.1
> Reporter: David Waite
> Attachments: struts-2.0.11.1-results-annotation-override.patch
>
>
> The ClasspathConfigurationProvider's ResultMap scans for Result and Results annotations on the class, going up the inheritance chain. However, this means that any annotations on a parent will write over annotations on the child.
> Example:
> @Result("/foo.jsp)
> public class FooAction {
> public String execute {
> return "success";
> }
> }
> ...
> @Result("/bar.jsp")
> public class BarAction extends FooAction {
> }
> the success result will always render foo.jsp, whether you are invoking FooAction or BarAction
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WW-2559) Result/Results annotations do not
override on subclasses
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Don Brown updated WW-2559:
--------------------------
Fix Version/s: 2.1.3
> Result/Results annotations do not override on subclasses
> --------------------------------------------------------
>
> Key: WW-2559
> URL: https://issues.apache.org/struts/browse/WW-2559
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.0.11.1
> Reporter: David Waite
> Fix For: 2.1.3
>
> Attachments: struts-2.0.11.1-results-annotation-override.patch
>
>
> The ClasspathConfigurationProvider's ResultMap scans for Result and Results annotations on the class, going up the inheritance chain. However, this means that any annotations on a parent will write over annotations on the child.
> Example:
> @Result("/foo.jsp)
> public class FooAction {
> public String execute {
> return "success";
> }
> }
> ...
> @Result("/bar.jsp")
> public class BarAction extends FooAction {
> }
> the success result will always render foo.jsp, whether you are invoking FooAction or BarAction
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WW-2559) Result/Results annotations do not
override on subclasses
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Don Brown resolved WW-2559.
---------------------------
Resolution: Fixed
Assignee: Don Brown
Looks like I already fixed it, but I added a unit test to prove it.
> Result/Results annotations do not override on subclasses
> --------------------------------------------------------
>
> Key: WW-2559
> URL: https://issues.apache.org/struts/browse/WW-2559
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.0.11.1
> Reporter: David Waite
> Assignee: Don Brown
> Fix For: 2.1.3
>
> Attachments: struts-2.0.11.1-results-annotation-override.patch
>
>
> The ClasspathConfigurationProvider's ResultMap scans for Result and Results annotations on the class, going up the inheritance chain. However, this means that any annotations on a parent will write over annotations on the child.
> Example:
> @Result("/foo.jsp)
> public class FooAction {
> public String execute {
> return "success";
> }
> }
> ...
> @Result("/bar.jsp")
> public class BarAction extends FooAction {
> }
> the success result will always render foo.jsp, whether you are invoking FooAction or BarAction
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.