You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nisith Dash <ni...@tcscal.co.in> on 2003/10/07 13:35:07 UTC

Using set-property attribute in action class

How can i access the propery of a bean which i have set in the struts config
file using <set-property> in my action class.

thanks,


Re: Using set-property attribute in action class

Posted by Kirk Wylie <kw...@m7.com>.
Oops, forgot to extend my first paragraph.

You have to write your own Configuration class which has a JavaBean 
property matching the "property" set in your <set-property> tag and 
which extends from ActionConfig. Then you can use that from your 
configuration file in order to get the parameter. The properties set are 
not general purpose, in that you can't just obtain them in general for 
any arbitrary ActionConfig instance.

HTH,
Kirk Wylie

Kirk Wylie wrote:

> You have to write your own Configuration class which has a
> 
> For example, if you wrote MyActionConfig and set up className in your
> Action element in your struts-config.xml file, and you had a tag of:
> <set-property property="foo" value="bar"/>, then
> MyActionConfig.setFoo(bar) would be called during configuration parsing
> time.
> 
> Kirk Wylie
> 
> Nisith Dash wrote:
> 
>  > How can i access the propery of a bean which i have set in the struts
>  > config
>  > file using <set-property> in my action class.
>  >
>  > thanks,
>  >
>  >
>  > ------------------------------------------------------------------------
>  >
>  > DISCLAIMER: The information contained in this message is intended 
> only and solely for the addressed individual or entity indicated in this 
> message and for the exclusive use of the said addressed individual or 
> entity indicated in this message (or responsible for delivery of the 
> message to such person) and may contain legally privileged and 
> confidential information belonging to Tata Consultancy Services. It must 
> not be printed, read, copied, disclosed, forwarded, distributed or used 
> (in whatsoever manner) by any person other than the addressee. 
> Unauthorized use, disclosure or copying is strictly prohibited and may 
> constitute unlawful act and can possibly attract legal action, civil 
> and/or criminal. The contents of this message need not necessarily 
> reflect or endorse the views of Tata Consultancy Services on any subject 
> matter. Any action taken or omitted to be taken based on this message is 
> entirely at your risk and neither the originator of this message nor 
> Tata Consultancy
> 
>  Services takes any responsibility or liability towards the same. 
> Opinions, conclusions and any other information contained in this 
> message that do not relate to the official business of Tata Consultancy 
> Services shall be understood as neither given nor endorsed by Tata 
> Consultancy Services or any affiliate of Tata Consultancy Services. If 
> you have received this message in error, you should destroy this message 
> and may please notify the sender by e-mail. Thank you.
> 
>  >
>  >
>  >
>  >
>  > ------------------------------------------------------------------------
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>  > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 



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


Re: Using set-property attribute in action class

Posted by Kirk Wylie <kw...@m7.com>.
You have to write your own Configuration class which has a

For example, if you wrote MyActionConfig and set up className in your 
Action element in your struts-config.xml file, and you had a tag of:
<set-property property="foo" value="bar"/>, then 
MyActionConfig.setFoo(bar) would be called during configuration parsing 
time.

Kirk Wylie

Nisith Dash wrote:

> How can i access the propery of a bean which i have set in the struts 
> config
> file using <set-property> in my action class.
> 
> thanks,
> 
> 
> ------------------------------------------------------------------------
> 
> DISCLAIMER: The information contained in this message is intended only and solely for the addressed individual or entity indicated in this message and for the exclusive use of the said addressed individual or entity indicated in this message (or responsible for delivery of the message to such person) and may contain legally privileged and confidential information belonging to Tata Consultancy Services. It must not be printed, read, copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person other than the addressee. Unauthorized use, disclosure or copying is strictly prohibited and may constitute unlawful act and can possibly attract legal action, civil and/or criminal. The contents of this message need not necessarily reflect or endorse the views of Tata Consultancy Services on any subject matter. Any action taken or omitted to be taken based on this message is entirely at your risk and neither the originator of this message nor Tata Consultancy
 Services takes any responsibility or liability towards the same. Opinions, conclusions and any other information contained in this message that do not relate to the official business of Tata Consultancy Services shall be understood as neither given nor endorsed by Tata Consultancy Services or any affiliate of Tata Consultancy Services. If you have received this message in error, you should destroy this message and may please notify the sender by e-mail. Thank you.
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org



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