Spring集成JSF的最簡單方式是使用DelegatingVariableResolver類
在facesconfigxml中配置 示例如下
<application>
<variableresolver>orgspringframeworkwebjsf
DelegatingVariableResolver</variableresolver>
<localeconfig>
<defaultlocale>zh_CN</defaultlocale>
<supportedlocale>en</supportedlocale>
<supportedlocale>zh_CN</supportedlocale>
</localeconfig>
<messagebundle>messages</messagebundle>
</application>
直接通過managedbean 的property屬性即可以得到spring中注入的bean
<managedbean>
<managedbeanname>goodsController</managedbeanname>
<managedbeanclass>webjsfGoodsController</managedbeanclass>
<managedbeanscope>request</managedbeanscope>
<! inject service >
<managedproperty>
<propertyname>goodsService</propertyname>
<value>#{goodsService}</value> <!注入Spring service >
</managedproperty>
</managedbean>
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28026.html