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>