You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Don Brown (JIRA)" <ji...@apache.org> on 2008/02/16 12:16:39 UTC
[jira] Commented: (WW-2448) Overriding convention-based actions
with declarative actions
[ https://issues.apache.org/struts/browse/WW-2448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43234#action_43234 ]
Don Brown commented on WW-2448:
-------------------------------
I'm not sure this is a bug, but rather how it works by design. Struts has never supported any sort of merging of Actions defined in multiple locations, and I don't see why one should expect it would here either. Either you define an action using the convention-based method or XML, but not a mixture of both. That would be a whole new feature that might have unexpected consequences.
> Overriding convention-based actions with declarative actions
> ------------------------------------------------------------
>
> Key: WW-2448
> URL: https://issues.apache.org/struts/browse/WW-2448
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Affects Versions: 2.1.1
> Reporter: Brian Pontarelli
> Assignee: Brian Pontarelli
> Fix For: 2.1.1
>
>
> Adding a declarative XML mapping for an action does not supercede the
> convention-based action, as one might expect.
> For example, given an Action like
> package actions;
> public class ExampleContactsAction {
> adding a mapping for example-contact with a result
> <package name="my-default" extends="json-default">
> <action name="example-contacts" class="actions.ExampleContactsAction">
> <result type="json"/>
> </action>
> </package>
> doesn't work. The system reports that a "success" mapping is not found.
> Adding a mapping under another name (name="contacts") works just fine.
> Using the @Result annotation also works (except that OGNL complains that
> the JSON result doesn't have a location property).
> * http://code.google.com/p/jsonplugin/issues/detail?id=26
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.