On Mon, Aug 31, 2009 at 4:27 PM, Java Struts<struts...@gmail.com> wrote: > Hi, > > could you please tell me how to post my question to this list? >
You just did... The next one will cost you $1 (just kidding), but for your next question, you'd be better off sending a separate email (not a reply to an existing message) so people won't consider your message to be thread-jacking. >> >> I'm learning to use the Convention Plugin. >> >> I understand from the excellent notes posted on the Wiki >> (http://cwiki.apache.org/WW/convention-plugin.html) that the plugin finds >> the Action classes and maps those action classes to Action names and >> results >> to specific JSPs. For example: >> >> Action Class -> Action URL -> View >> com.example.actions.MainAction -> /main -> >> /WEB-INF/content/main-success.jsp >> >> What I'm not clear on is what method is called in the Action Class. Is it >> always the execute method? Is there a way in the Action URL to specify >> which method to call? >> >> I know that I could use Struts 2 @Action annotation to map a method to an >> Action URL, but I'm wondering if there is a way to call a specific method >> in >> the Action class using just the Convention plugin and no annotations. >> >> Thanks for the help. >> It is going to default to the 'public String execute()' method. It might be possible to use the exclamation point to try to get the plugin to call a specific method -> http://localhost:8080/app/action!differentMethod Really though, this goes against the notion of 'conventions over configuration.' The @Action annotation would be a much more maintainable way to handle this sort of thing. -Wes -- 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