You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by john lee <sh...@yahoo.com> on 2009/04/12 03:37:20 UTC
struts 2, implements Action / extend ActionSupport
i am aware that in struts 2, when define an action, it could be
public class XXX implement Action
or
public class XXX extends ActionSupport
what is the difference b/w above two? in other words, in what kind of scenario, pick which one?
tks in advance
john
Re: struts 2, implements Action / extend ActionSupport
Posted by Dave Newton <ne...@yahoo.com>.
john lee wrote:
> i am aware that in struts 2, when define an action, it could be
>
> public class XXX implement Action
> or
> public class XXX extends ActionSupport
>
> what is the difference b/w above two? in other words, in what kind of scenario, pick which one?
If you want validation or I18N support, and don't want to write it
yourself, use ActionSupport. As Steven said, you don't actually *have*
to implement Action for things to work (I don't recall if there's any
performance penalty incurred by forcing the use of reflection to find an
execute() method).
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: struts 2, implements Action / extend ActionSupport
Posted by Dave Newton <ne...@yahoo.com>.
Martin Gainty wrote:
> assuming you are using Actions
> annotation to define multiple action methods within a single action class? @Action("/different/url")
> http://cwiki.apache.org/WW/convention-plugin.html
How does this differentiate between implementing Action or extending
ActionSupport?
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: struts 2, implements Action / extend ActionSupport
Posted by Martin Gainty <mg...@hotmail.com>.
assuming you are using Actions
annotation to define multiple action methods within a single action class? @Action("/different/url")
http://cwiki.apache.org/WW/convention-plugin.html
?
Martin
______________________________________________
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Sun, 12 Apr 2009 22:11:09 +0800
> Subject: Re: struts 2, implements Action / extend ActionSupport
> From: kenshin520@gmail.com
> To: user@struts.apache.org
>
> >
> > basically ActionSupport gives you some default implemented methods to make
> > your life easier.
>
> if you dont need them you can simply implement Action
> But for Struts2 you dont even HAVE to implement the Action interface, as
> long as you have a method called "execute" or any named method that your
> calling
>
> >
_________________________________________________________________
Quick access to your favorite MSN content and Windows Live with Internet Explorer 8.
http://ie8.msn.com/microsoft/internet-explorer-8/en-us/ie8.aspx?ocid=B037MSN55C0701A
Re: struts 2, implements Action / extend ActionSupport
Posted by Steven Yang <ke...@gmail.com>.
>
> basically ActionSupport gives you some default implemented methods to make
> your life easier.
if you dont need them you can simply implement Action
But for Struts2 you dont even HAVE to implement the Action interface, as
long as you have a method called "execute" or any named method that your
calling
>