You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eric SCHULTZ <Er...@elixonline.com> on 2004/02/04 02:15:20 UTC

How to set properties on actions?

Good evening...

i'm trying to use set-property on my action, in struts-config.xml i have:
<action path="/BillPayment"
type="com.elixonline.TECO.ivr.CustomerInformation.BillPayment">
    <set-property property="noTransferDays" value="MONDAY"/>
</action>

and my class defines
public void setNoTransferDays(String string) {
	noTransferDays = string;
}

but i always get the following error in Tomcat 4.1.27 when i start the
application:
javax.servlet.UnavailableException: Parsing error processing resource path 

if i comment out just the set-property then the application starts no
problem.

any ideas?  i couldn't find anything in the mail archive or the Struts site
(all the set-property references were for plug-ins and datasources).

Eric Schultz.

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


Re: How to set properties on actions?

Posted by Joe Germuska <Jo...@Germuska.com>.
"set-property" refers to a property of the *action-mapping*, not the 
*action*.  The class which needs to define "noTransferDays" should 
extend org.apache.struts.action.ActionMapping, and is specified in 
the XML using the "className" attribute (as opposed to "type").

Then in your Action, cast the ActionMapping which is passed into 
execute() to the necessary type, or use Commons BeanUtils to get the 
property.

Joe


At 8:15 PM -0500 2/3/04, Eric SCHULTZ wrote:
>Good evening...
>
>i'm trying to use set-property on my action, in struts-config.xml i have:
><action path="/BillPayment"
>type="com.elixonline.TECO.ivr.CustomerInformation.BillPayment">
>     <set-property property="noTransferDays" value="MONDAY"/>
></action>
>
>and my class defines
>public void setNoTransferDays(String string) {
>	noTransferDays = string;
>}
>
>but i always get the following error in Tomcat 4.1.27 when i start the
>application:
>javax.servlet.UnavailableException: Parsing error processing resource path
>
>if i comment out just the set-property then the application starts no
>problem.
>
>any ideas?  i couldn't find anything in the mail archive or the Struts site
>(all the set-property references were for plug-ins and datasources).
>
>Eric Schultz.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org


-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
       "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
             -- Jef Raskin

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