Using JSF as view technology of Spring MVC

前端 未结 3 505
清歌不尽
清歌不尽 2020-11-22 05:02

I am currently implementing a small Spring MVC PoC, and I would like to use JSF as the view technology since most people in my company are used to a J2EE with Primefaces env

3条回答
  •  一生所求
    2020-11-22 05:46

    Spring MVC and JSF don't really mix. You can use JSF for the view related stuff and have Spring manage and wire the backed (services, daos etc.). But trying to match @Controllers with JSF pages isn't something that really works nicely (next to that both are different stacks request based against component-based).

    To integrate Spring with JSF you will need to add the SpringBeanFacesELResolver to your faces-config.xml. That will lookup beans from Springs application context. For this to work you have to use plain JSF annotations and not the CDI based annotations.

提交回复
热议问题