On 9/11/06, Ted Husted <[EMAIL PROTECTED]> wrote:
The Spring bean can be instantiated as a singleton, and any change made to the object via the property would be to the singleton instance, and reflected anywhere else the object is referenced, including another Action class. I believe that there may be notions of "session" in the Spring API, but I would have to look. (Though, I may also be thinking of Spring.WEB for .NET.) Generally, a Spring bean is a singleton or not-a-singleton, so the scope is either global or local.
In Spring2, you have the additional option to create Spring beans in a scope (request, session, or application). But for Spring1 the above statement is accurate. Craig Something to note is that in S2, Actions are *not* singletons, so a
Spring bean injected to an Action is only a singleton if Spring makes it so. -- HTH, Ted. * http://www.husted.com/struts/ On 9/11/06, Garner Shawn <[EMAIL PROTECTED]> wrote: > It is already autowiring into my action. > I want to autowire out from of my action into spring so it can get > autowired in other actions after I set the value and don't want to > copy all the bean values from one object to another. > > I realize I could autowire an enclosing bean and then set the value > but I think it'd be just as easy to set the bean back into spring. > > Also are spring beans scoped? Application, Session? > > Shawn > > >2006/9/10, Ted Husted <[EMAIL PROTECTED]>: > > > > On 9/9/06, Garner Shawn <[EMAIL PROTECTED]> wrote: > > > I want to set the value of the spring bean defined in the spring xml > > file. > > > I have the value in the action but I want to set the spring bean's > > > value with it. > > > > Given a matching property, Struts 2 can automatically inject a Spring > > bean into the Action. > > > > Set the beans to autowire and autodect > > > > <beans default-autowire="autodetect"> > > > > .... > > > > </beans> > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]