[jboss-user] [JBoss Seam] - Re: Seam with Spring?

adambrod do-not-reply at jboss.com
Tue Oct 24 14:37:31 EDT 2006


The easiest way to integrate Spring and Seam, that I've found, is to use a JSF variable resolver and only have the dependencies go from Seam to Spring.

In the presentation tier, you can use Seam to manage your controllers (and conversations and lots of other good stuff).  In the backend tier you can use Spring to manage your stateless services (Daos, Repositories, any Service).  Then, you can inject your services into your Seam controllers using the Seam @In(#{mySpringService}) notation.  Seam recognizes JSF expressions.  

Spring ships with a JSF variable resolver.  You just need to register it in your faces-config.xml.  

<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>

You can use Spring to manage your services (instead of using Stateless Session beans, for example), you can use Seam to manage your controllers (aka JSF managed-beans) and conversations.   So the Seam components can reference Spring components, but Spring components cannot reference Spring components.  

I hope this helps.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980480#3980480

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980480



More information about the jboss-user mailing list