On 7/4/06, Enrique Medina Montenegro <[EMAIL PROTECTED]> wrote:
Hi,

I'm starting a new development where I will use MyFaces together with Shale and Spring. I've been reading the documentation regarding the integration between Spring and Shale, in terms of the delegating VariableResolver. Furthermore, I've been reading the documentation regarding Tiger extensions for Shale.

So the point is I want to use both the Spring integration and the Tiger extensions for the same purpose: get my JSF managed beans.

And here comes the question. Is it possible to combine both the @Bean annotation and the definition of the bean in the applicationContext.xml from Spring? The reason for this question is very simple, and maybe there's a workaround for it without having to use both functionalities all together: I would like to define all my beans within Spring's applicationContext.xml, but I don't know how to indicate the scope for those beans, so I was wondering whether the use in conjunction with the @Bean(name="xxxxBean" scope=Scope.REQUEST) annotation would help to achieve the desired result.

Currently this combination will not do what you want ... the @Bean annotation focuses only on replacing declarations in a faces-config.xml file (and, implicitly, replacing declarations in applicationContext.xml as well).  To get what you're after, I would look at a couple of different things:

* There's a spring-jsf extensions project at SourceForge that
  implies it can store Spring beans into a specified scope
  (I haven't actually tried this one).

* Spring 2 is supposed to have this feature, as part of its JSF
  integration, out of the box.

Craig


Thanks.

Reply via email to