开发者

Integrating JSF with Spring

开发者 https://www.devze.com 2022-12-29 19:13 出处:网络
I haven\'t implemented any code, I\'m still working the overall architecture for a new application and this going to be the first time I use JSF+Spring.

I haven't implemented any code, I'm still working the overall architecture for a new application and this going to be the first time I use JSF+Spring.

I need to put web services in front of th开发者_开发技巧e Spring service beans (business logic tier) since these beans could be accessed by other applications besides the presentation tier. While defining the different layers or tiers for the application, I feel unsure about how to integrate JSF (the presentation tier) with Spring (the business tier in this application).

I'm considering to define some sort of common tier or service tier in order to provide the glue code for JSF and Spring, but before that I want to hear from others what have they done or if they have used other frameworks to help with the glue code for this scenario (I already checked Spring MVC/Spring Faces, but I'm not sure if that's what I need since I'm thinking of this application more like JSF-centric than Spring-centric, but maybe you could help me about considering another approach).

Thanks in advance.


The "glue" is the spring ELResolver, which you must configure in your faces-config.xml:

<application>    
    <!--
        This is the JSF 1.2 ELResolver that delegates to the Spring root
        WebApplicationContext resolving name references to Spring-defined
        beans.
    -->
    <el-resolver>
         org.springframework.web.jsf.el.SpringBeanFacesELResolver
    </el-resolver>
 </application>

This means that each #{bean.property} is handled by the resolving the bean in the spring context.

0

精彩评论

暂无评论...
验证码 换一张
取 消