| 導購 | 订阅 | 在线投稿
分享
 
 
 

實例講解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>
󰈣󰈤
王朝萬家燈火計劃
期待原創作者加盟
 
 
 
>>返回首頁<<
 
 
 
 
 熱帖排行
 
 
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有