0
我想在JSF ManagedBean中注入spring bean。現在我用: 的applicationContext.xml:如何在Spring + JSF應用程序中使用JSF註釋
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<bean id="service" class="com.evgeny.domain.TestService"></bean>
</beans>
臉-config.xml中:
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<application>
<el-resolver>
org.springframework.web.jsf.el.SpringBeanFacesELResolver
</el-resolver>
</application>
<managed-bean>
<managed-bean-name>facesBean</managed-bean-name>
<managed-bean-class>com.evgeny.jsf.FacesBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>service</property-name>
<value>#{service}</value>
</managed-property>
</managed-bean>
</faces-config>
...和它的作品。但是我想爲JSF bean使用註釋。那麼如何在@ManagedBean
註釋bean中注入TestService
?