Typically you would derive it in order to add a new property, which value
can be set in the struts-config.xml (as Ted described in his post). This
property can be used for example to control the logic of
ActionForm.validate() or of Action.perform(): both are given the
ActionMapping instance as parameter and thus can access this extra property.
That would be a nice way to integrate a validation framework: this extra
property can specify which validation logic to use.

Fr.

-----Original Message-----
From: Mark Woon [mailto:[EMAIL PROTECTED]]
Sent: 16 January 2002 01:15
To: Struts Users Mailing List
Subject: Re: Subclassing ActionMapping


Ted Husted wrote:

> You can create your own ActionMapping subclass, and specify that in the
> web.xml.
>
> If it uses additional methods, you would type-cast the mapping in the
> perform to access those, just as you type-case the ActionForm to get to
> its extended properties.
>
> To set new properties on the ActionMapping subclass, you can use the
> Digester syntax:
>
>     <set-property property="myProperty" value="myValue" />
>
> to avoid touching the struts-config syntax.

You know, I've never really understood what to do with the ActionMapping
objects.
Maybe that's because I absolutely don't need to touch it, like I don't need
to
touch ActionServer, but it kinda nags at me.

So, why/when would I want to subclass ActionMapping?

Thanks,
-Mark


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
************************************************************************
The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***********************************************************************


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to