You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by deepak saini <de...@hotmail.com> on 2003/12/31 13:37:52 UTC

creating a class that extends Action Mapping...what is the purpose of it?

Hi,

I was trying one struts example. In that example, it has created one class 
whcih extends ActionMapping class. I was just wondering why we need to 
create this class and when is it used and whether we define this class in 
struts-config or web.xml?

Regards
Deepak Saini

_________________________________________________________________
Contact brides & grooms FREE! Only on www.shaadi.com. 
http://www.shaadi.com/ptnr.php?ptnr=hmltag Register now!


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


Re: creating a class that extends Action Mapping...what is the purpose of it?

Posted by Nicolas De Loof <ni...@cgey.com>.
Sometime we need to add some info to struts mappings, and for this we use a class that extends ActionMapping. As an
example, we need for a webapp to add a "description" to any mapping to build some stats.

DescActionMapping defines a "description" attribute.

every action-mapping in struts-config sets this property :

<action-mappings type="DescActionMapping">

    <action path="/login"
        name="LoginForm"
        input="error"
        scope="request"
        type="ConnexionAction" >

        <set-property property="description" value="Authentification"/>

        <forward name="success" path="/accueil.do" />
        <forward name="error" path="tiles:connexion" />
    </action>
(...)

Nico.



> Hi,
>
> I was trying one struts example. In that example, it has created one class
> whcih extends ActionMapping class. I was just wondering why we need to
> create this class and when is it used and whether we define this class in
> struts-config or web.xml?
>
> Regards
> Deepak Saini
>
> _________________________________________________________________
> Contact brides & grooms FREE! Only on www.shaadi.com.
> http://www.shaadi.com/ptnr.php?ptnr=hmltag Register now!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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


RE: creating a class that extends Action Mapping...what is the purpose of it?

Posted by Mohan Radhakrishnan <mr...@cellexchange.com>.
I remember that this is done to use custom properties in your action mapping
in the struts-config.xml file.

<action  ... >
      <set-property property="foo" value="x"/>
      <set-property property="bar" value="y"/>
    </action>

You can access them in your action.

Mohan

-----Original Message-----
From: deepak saini [mailto:deepak_saini@hotmail.com]
Sent: Wednesday, December 31, 2003 6:08 PM
To: struts-user@jakarta.apache.org
Subject: creating a class that extends Action Mapping...what is the
purpose of it?


Hi,

I was trying one struts example. In that example, it has created one class
whcih extends ActionMapping class. I was just wondering why we need to
create this class and when is it used and whether we define this class in
struts-config or web.xml?

Regards
Deepak Saini

_________________________________________________________________
Contact brides & grooms FREE! Only on www.shaadi.com.
http://www.shaadi.com/ptnr.php?ptnr=hmltag Register now!


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


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