You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <cr...@apache.org> on 2001/06/02 06:41:45 UTC

Re: New ActionMapping Class


On Tue, 22 May 2001, Michael Binette wrote:

> I created a new GenericActionMapping class that extends ActionMapping.  I
> added one property, processAction with public getter and setter methods for
> it.
> 
> I then set the mapping property in web.xml for the struts Action servlet to
> my new GenericActionMapping class.  The log when I run TomCat correctly
> shows it using my new GenericActionMapping class.
> 
> But, if I add processAction="whatever" to my struts-config.xml, within the
> <action> element, I get a SAXParseException, Attribute "processAction" is
> not declared for element "action".
> 

This error happens because your struts-config.xml document now violates
the DTD.

> How do I get this to work?
> 

That's what the <set-property> element is for:

    <action path="..." ...>
      <set-property property="processAction" value="yadda yadda"/>
    </action>

This little trick lets you extend the syntax of an ActionMapping, and add
new configurable properties, without having to modify the DTD.

> --
> Thanks,
> Michael Binette
> 
> 

Craig McClanahan