struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Sawyer <tsaw...@nildram.co.uk>
Subject Re: Arbitrary parameters in ActionMapping?
Date Sat, 01 Jun 2002 11:53:11 GMT
Doesn't this have multiuser issues?  If there is only one action class
instance given multiple users of the action, how do you get data from
this set() method to read it in the main perform() method?

What am I missing?

Tim.

On Fri, 2002-05-31 at 22:03, James Holmes wrote:
> 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
> james@jamesholmes.com
> http://www.jamesholmes.com/struts/
> 
> 
> --- Raffy_Lata@ffic.com wrote:
> > 
> > Once the properties are defined in the config xml,
> > how do you access them
> > from the action class?
> > 
> > 
> > 
> > 
> > 
> > James Holmes <jholmes612@yahoo.com> on 05/31/2002
> > 01:32:51 PM
> > 
> > Please respond to "Struts Users Mailing List"
> >       <struts-user@jakarta.apache.org>
> > 
> > To:   Struts Users Mailing List
> > <struts-user@jakarta.apache.org>
> > 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
> > james@jamesholmes.com
> > 
> > 
> > --- Rick Mann <rmann@latencyzero.com> 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:struts-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <mailto:struts-user-help@jakarta.apache.org>
> > >
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! - Official partner of 2002 FIFA World Cup
> > http://fifaworldcup.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:   <
> > mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <
> > mailto:struts-user-help@jakarta.apache.org>
> > 
> > 
> > 
> > 
> > 
> > 
> >
> **********************************************************************
> > 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:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
> 



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


Mime
View raw message