The annotation was allowed to be applied to classes in 2.1.6, but it
was ignored. For 2.1.7 it will be allowed only in methods.There are no
advantages in having multiple @Action annotations at the class level,
instead of the method level.

musachy

On Sun, Apr 26, 2009 at 3:18 PM, Andreas Joseph Krogh
<[email protected]> wrote:
> On Sunday 26 April 2009 08:29:57 pm Wes Wannemacher wrote:
>> On Sunday 26 April 2009 02:22:50 pm Andreas Joseph Krogh wrote:
>> > Hi.
>> > I see that https://issues.apache.org/struts/browse/WW-2394 is closed with
>> > resolution=implemented with a comment referring to the Convention-plugin. I
>> > cannot se how it's possible with the Convention-plugin to map different
>> > names to an action using annotations.
>> >
>> > Say I have UserAction and want to map it as /mynamespace/showuser *and*
>> > /mynamespace/anotheralias for some reason, how is this possible using the
>> > Convention-plugin as the @Action-annotation is not applicable to classes?
>>
>>
>> The @Action annotation is meant to point to methods, and you can do it like -
>>
>> @Actions( {
>>   @Action(/mynamespace/showuser),
>>   @Action(/mynamespace/anotheralias)
>> })
>> public String execute() {
>> ...
>>
>>
>> That is what I thought you were looking for, if it's not I'm sorry, go ahead
>> and re-open, preferably against the Conventions plugin and make a comment
>> letting us know a bit more about what you're looking for (and remember,
>> patches are welcomed!).
>
> What I'm looking for is the above example but on the action-class itself, not 
> on the individual methods. Any reason why the @Actions-annotation is not 
> ElementType.TYPE in addition to ElementType.METHOD? The @Action-annotation is 
> applicable to classes, but isn't respected it seems.
>
> If it'll bee accepted I'll be happy to provide a patch extending the 
> @Actions-annotation to also be of ElementType.TYPE and make both @Actions and 
> @Action work on action-classes aswell.
>
> --
> Andreas Joseph Krogh <[email protected]>
> Senior Software Developer / CEO
> ------------------------+---------------------------------------------+
> OfficeNet AS            | The most difficult thing in the world is to |
> Rosenholmveien 25       | know how to do a thing and to watch         |
> 1414 Trollåsen          | somebody else doing it wrong, without       |
> NORWAY                  | comment.                                    |
>                        |                                             |
> Tlf:    +47 24 15 38 90 |                                             |
> Fax:    +47 24 15 38 91 |                                             |
> Mobile: +47 909  56 963 |                                             |
> ------------------------+---------------------------------------------+
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to