开发者

Manage beans via Spring or via JSF

开发者 https://www.devze.com 2023-03-12 10:23 出处:网络
In my JSF Webapp I am 开发者_如何学Cusing Spring vor DI etc. At the moment I have my beans managed by Spring.

In my JSF Webapp I am 开发者_如何学Cusing Spring vor DI etc.

At the moment I have my beans managed by Spring. (SpringBeanFacesELResolver defined in faces-config.xml)

But I'm not sure, if this is the right way... For example: A bean defined in Spring cannot use the new JSF 2 view scope, right?

My question is not, if I should use Spring or not... Just HOW to manage my beans?!


You should in any case stick with one DI in your project. For me, Spring is clearly much more powerful that JSF managed beans. So I would opt to Spring in this situation.

You can hanlde view scope in Spring using custom scopes, it is quite straigtforward actually. Here's a blog post on this question.

0

精彩评论

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