Do we declare the variable which holds the value of the property test as an instance variable? If so will the class be thread safe?
-----Original Message----- From: James Holmes [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 6:03 PM To: Struts Users Mailing List Subject: Re: Arbitrary parameters in ActionMapping? That's just the thing. You have to define a method in your action class for each <set-property> element you define. Basically if you have a property names "test" then your action class needs a method called setTest(String str). HTH, -james [EMAIL PROTECTED] http://www.jamesholmes.com/struts/ --- [EMAIL PROTECTED] wrote: > > Once the properties are defined in the config xml, > how do you access them > from the action class? > > > > > > James Holmes <[EMAIL PROTECTED]> on 05/31/2002 > 01:32:51 PM > > Please respond to "Struts Users Mailing List" > <[EMAIL PROTECTED]> > > To: Struts Users Mailing List > <[EMAIL PROTECTED]> > cc: > Subject: Re: Arbitrary parameters in ActionMapping? > > > Rick, > > You can already accomplish what you are describing > with the current Struts architecture via > <set-property> elements. > > <action ...> > <set-property property="prop" value="val"> > </action> > > This will call the setProp(String value) method of > your action object with the "val" value. > > The Struts Console makes it easy for setting these > properties on actions. > > http://www.jamesholmes.com/struts/ > > -james > [EMAIL PROTECTED] > > > --- Rick Mann <[EMAIL PROTECTED]> wrote: > > I've noticed a few people proposing solutions for > > various framework > > limitations that use the "param" attribute of the > > <action> tag. Obviously, > > only one parameter can reasonably be passed in > this > > attribute. > > > > Does it not make sense to add a nested tag for > > parameters? In the build of > > Struts that I'm using, I haven't noticed anything > > like this. I was thinking > > along the lines of something like this: > > > > <action path = "/someaction" > > type = "com.foo.bar.action.Action"> > > > > <param name="param1" value="value1" /> > > <param name="param2" value="value2" /> > > </action> > > > > Or, if you want to get XML-happy: > > > > <action path = "/someaction" > > type = "com.foo.bar.action.Action"> > > > > <action-param> > > <param-name>param1</param-name> > > <param-value>value1</param-value> > > </action-param> > > </action> > > > > but I don't know if that's strictly necessary > (I'll > > let the smarter people > > on the project decide). > > > > In any event, in the code, you could write > something > > like: > > > > String val1 = mapping.getParameter("param1"); > > String val2 = mapping.getParameter("param2"); > > > > The method shouldn't even need to be named > > differently, as the existing > > getParameter() takes no arguments. There would > > obviously be corresponding > > setParameter(String) calls. > > > > How does this seem? > > > > -- > > Rick > > > > > > > > -- > > To unsubscribe, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > __________________________________________________ > Do You Yahoo!? > Yahoo! - Official partner of 2002 FIFA World Cup > http://fifaworldcup.yahoo.com > > -- > To unsubscribe, e-mail: < > mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: < > mailto:[EMAIL PROTECTED]> > > > > > > > ********************************************************************** > Please Note: > The information in this E-mail message, and any > files transmitted > with it, is confidential and may be legally > privileged. It is > intended only for the use of the individual(s) named > above. If you > are the intended recipient, be aware that your use > of any confidential > or personal information may be restricted by state > and federal > privacy laws. If you, the reader of this message, > are not the > intended recipient, you are hereby notified that you > should not > further disseminate, distribute, or forward this > E-mail message. > If you have received this E-mail in error, please > notify the sender > and delete the material from any computer. Thank > you. > ********************************************************************** > > > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>