| 订阅 | 在线投稿
分享
 
 
 

实例讲解Spring集成JSF的最简单方式

来源:互联网  宽屏版  评论
2008-06-01 02:22:26

Spring集成JSF的最简单方式是使用DelegatingVariableResolver类

在faces-config.xml中配置,示例如下:<application><variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver><locale-config><default-locale>zh_CN</default-locale><supported-locale>en</supported-locale><supported-locale>zh_CN</supported-locale></locale-config><message-bundle>messages</message-bundle></application>直接通过managed-bean 的property属性即可以得到spring中注入的bean:<managed-bean><managed-bean-name>goodsController</managed-bean-name><managed-bean-class>web.jsf.GoodsController</managed-bean-class><managed-bean-scope>request</managed-bean-scope><!-- inject service --><managed-property><property-name>goodsService</property-name><value>#{goodsService}</value> <!--注入Spring service --></managed-property></managed-bean>

Spring集成JSF的最简单方式是使用DelegatingVariableResolver类 在faces-config.xml中配置,示例如下:<application><variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver><locale-config><default-locale>zh_CN</default-locale><supported-locale>en</supported-locale><supported-locale>zh_CN</supported-locale></locale-config><message-bundle>messages</message-bundle></application>直接通过managed-bean 的property属性即可以得到spring中注入的bean:<managed-bean><managed-bean-name>goodsController</managed-bean-name><managed-bean-class>web.jsf.GoodsController</managed-bean-class><managed-bean-scope>request</managed-bean-scope><!-- inject service --><managed-property><property-name>goodsService</property-name><value>#{goodsService}</value> <!--注入Spring service --></managed-property></managed-bean>
󰈣󰈤
 
 
 
>>返回首页<<
 
 热帖排行
 
 
王朝网络微信公众号
微信扫码关注本站公众号wangchaonetcn
 
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
©2005- 王朝网络 版权所有