You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anand Patil <ap...@syndera.com> on 2004/02/04 22:06:12 UTC

Using Parameter in Action via the struts-config.xml

Hi All,
  The struts configuration DTD supports having a "parameter" attribute
to a "action". But how can I get the value specified in the "parameter"
attribute in my action class. Also using "set-property" inside a
"action" tag does not work? Anyone have any idea about this? 


Regards
Anand Patil

RE: Using Parameter in Action via the struts-config.xml

Posted by Robert Taylor <rt...@mulework.com>.
> .... But how can I get the value specified in the "parameter"
> attribute in my action class.
ActionMapping.getParameter() will get you the value of the parameter
attribute.

> .... Also using "set-property" inside a
> "action" tag does not work?
It works for me. You have to subclass ActionMapping and declare it in your
struts-config file.

<action-mappings type="com.companyname.SubclassedActionMapping">


So when you use set-property, Struts can set those values using reflection.
My guess as to why
its not working is that it silently fails to set those properties because
they don't exist
in the default ActionMapping class.



robert


> -----Original Message-----
> From: Anand Patil [mailto:apatil@syndera.com]
> Sent: Wednesday, February 04, 2004 4:06 PM
> To: struts-user@jakarta.apache.org
> Subject: Using Parameter in Action via the struts-config.xml
>
>
> Hi All,
>   The struts configuration DTD supports having a "parameter" attribute
> to a "action". But how can I get the value specified in the "parameter"
> attribute in my action class. Also using "set-property" inside a
> "action" tag does not work? Anyone have any idea about this?
>
>
> Regards
> Anand Patil
>


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