I think you got the wrong end of the stick. The <action> elements in
struts-config relate to ActionMapping classes, not the Action class.

You need to sub-class the ActionMapping class and add your properties and
getters/setters to that class.

Then you need to add a <init-param> element for the ActionSrvlet to the
web.xml to tell it to use your custom ActionMapping class as follows:

  <init-param>
     <param-name>mapping</param-name>
     <param-value>com.myPackage.myActionMapping</param-value>
  </init-param>

Then in your action class you need to cast the mapping object to your custom
class and then call the getter to retrieve the property values.

Niall

> -----Original Message-----
> From: David Holland [mailto:[EMAIL PROTECTED]]
> Sent: 11 May 2001 18:08
> To: '[EMAIL PROTECTED]'
> Subject: How can I use <set-property property="foo" value="123" /> in
> struts-config.xml
>
>
> How can I use <set-property property="foo" value="123" /> in
> struts-config.xml ?
>
> I want to use it in place of forward to store Action configuration info
> (set-property is
> specified in the dtd).
>
> Tried to add getter & setter to Action descendant - but assignment by
> introspection
> didn't seem to work.
>
> Looked at the source for ActionServlet, and the digester class does appear
> to be doing something
> with this property, although it looks like it is only looking for a single
> instance in an action.
>
> As far as I can tell, either it is not intended for general use or it is
> broken.
>
> Any thoughts?
>
> David Holland
> [EMAIL PROTECTED]
>
>

Reply via email to