You might want to take a look at shale's spring integration (http://struts.apache.org/struts-shale/features-spring-integration.html).  It allows seamless access to spring beans using the standard JSF API.
 
Another very cool thing is the tiger extentions (http://struts.apache.org/struts-shale/features-tiger-extensions.html).  It allows you to create annotated managed beans.  This is acomplished by creating a custom variable resolver (http://svn.apache.org/viewcvs.cgi/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java?rev=369992&view=log).
 
Gary
 
-------------- Original message --------------
From: Andrew Robinson <[EMAIL PROTECTED]>
If the faces context is active (there is a currently processing facelets request), you can just use the static methods on the faces context to get the current context, and use the standard JSF APIs for injecting information into the session/request/page, etc. I have been able to get beans and such from non-JSF code in the past by using the faces context. Just make sure that a faces context has indeed been started for your request.

On 1/20/06, Yee CN <[EMAIL PROTECTED]> wrote:

Hi,

 

Is there are way to get hold of JSF bean factory and instantiate managed beans outside of JSF?

 

My reason for asking is that I have spring IOC for business tier, JSF IOC for web tier, + jsf-spring integration. My web tier also contains helper classes for servlets that I need to inject dependencies from the business tier. I like to keep spring's applicationContext exclusive to the business & persistent tier, so my next best bet is to place them under JSF managed beans.

 

Or is there a better approach?

 

Many thanks in advance.

Yee


Reply via email to