At first glance, I would think that what you describe would be the
easiest method. For instance, I would do the following -

@Override
@Action("/url")
public String method() {
    return super.method();
}

This would get a bit tedious if you have a significant number of
actions. If you have a lot of methods, take a look at creating your
own action mapper and implement your own annotation. Implementing your
own action mapper is easier than it sounds and there are plenty of
example plugins.

-Wes

On Wed, Apr 21, 2010 at 8:44 AM, Robert Taylor <rtay...@dtgresults.com> wrote:
> Greetings,
>
> We are converting from using Struts1 and XDoclet to Struts2 and Struts2 
> annotations.
>
> We have a base action class which handles requests which displays grid style 
> information.
> The super class is a template pattern which does a lot of the common heavy 
> lifting and exposes
> a method "display" which is invoked by a name specified in the action 
> configuration for the url.
> Subclasses simply implement a method to retrieve a collection of objects.
>
> What we have been doing is placing the XDoclet annotations in the subclasses 
> which specified
> the url and the method to invoke.
>
> With Struts2, I don't see that this is possible using just the annotations.
> It appears subclasses will have to override the superclass method just to 
> bind a url.
> I don't see that the @Action annotation supports a "method" parameter or it 
> may be possible.
>
> The same problem will occur for our CRUD action super classes.
> The subclasses will have to override the super class methods just to bind the 
> method name to the url.
>
> So, am I missing something? Is it possible to use Struts2 annotations such 
> that subclasses don't have
> to override super class methods simply to bind the method name to the url?
>
> /robert
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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

Reply via email to