You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Howard Moore <Ho...@Datapulse.com> on 2001/02/01 10:40:13 UTC
RE: parameters for actions
According to the struts-config DTD (as of 20010128) the action element
doesn't contain a className attribute so if you try this you get a
SAXParseException when parsing struts-config.xml.
The digester does appear to handle the className attribute, however, so this
is probably just a bug in the DTD. Unless it has been fixed in a more recent
build?
> -----Original Message-----
> From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
> Sent: 31 January 2001 22:32
> To: struts-user@jakarta.apache.org
> Subject: Re: parameters for actions
>
>
> christian reichlin wrote:
>
> > hi,
> >
> > im looking for an easy way to "configure" actions.
> >
>
> One general approach to this comes from the fact that you can
> subclass the
> ActionMapping class with your own, which could then include
> some additional
> properties. Then, you could say:
>
> <action className="com.mycompany.MyActionMapping
> path="/...">
> <parameter name="requiredFields" value="....."/>
> </action>
>
> Now, when your action's perform() method is called, a reference to the
> ActionMapping is passed, and you can call:
>
> String requiredFields =
> ((MyActionMapping) mapping).getRequiredFields();
>
>
> > christian
>
> Craig
>
>