A simple way to do this is to define a Spring bean and then expose that as an Action property. Struts will automatically inject the Spring bean into the Action if the Action property name matches the Spring Bean ID.
* http://jroller.com/page/TedHusted?entry=struts_2_spring_love_fest As others have mentioned, the scope parameter in Struts 1 refers to the FormBean, not the Action. All Struts 1 Actions are "application scope". In Struts 2, any POJO can serve as a "formbean" via Model Driven, any POJO can be injected into an Action via Spring. -- HTH, Ted. * http://www.husted.com/struts/ On 10/11/06, Sébastien LABEY <[EMAIL PROTECTED]> wrote:
Yes, I understand that, but it can be useful to specify the scope of an action. For example, you could have to search for a list of objects in DB to help the user to select the right item (let's imagine there are too much items to have them in one time on your page), and you would like to save your actual navigation, so you specify it a scope="session"... With this, you know where too search for the objects you have save, you simply search in the scope specified with the action. So it seems I have to find another solution... Anyway, thanks for your answer. Sebastien On 10/11/06, Dave Newton <[EMAIL PROTECTED]> wrote: > > From: Sébastien LABEY [mailto:[EMAIL PROTECTED] > > I was used to specify a scope (request or session) for in the action > > configuration in struts-config.xml with struts1.x, and I used it to know > > where to store some parameters. > > My understanding (as a Struts2 n00b) is that since there are no form beans > in Struts2 the 'scope' attribute would no longer make sense. > > Dave
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]