I met a problem when injecting spring bean into jsf bean, which causes javax.faces.FacesException(Can't instantiate class), javax.faces.el.EvaluationException
Here is my xml files:
File WEB-INF/components.xml defines spring beans
<beans>
<bean id="rambo.api.VideoService"
class="rambo.impl.VideoServiceImpl">
<!-- some properties ... -->
</bean>
</beans>
File WEB-INF/faces-config.xml define jsf beans
<managed-bean>
<description>Video Home Bean</description>
<managed-bean-name>videoBean</managed-bean-name>
<managed-bean-class>rambo.tool.VideoBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<description>videoService</description>
<property-name>videoService</property-name>
<value>#{Components["rambo.api.VideoService"]}</value>
</managed-property>
<!-- Other properties -->
</managed-bean>
File videoMain.jsp:
In resourceToolExists: the videoBean uses some methods of videoService
<h:panelGroup rendered="#{! videoBean.resourceToolExists" >
<%@ include file="videoNoResource.jsp" %>
</h:panelGroup>
Here gets: javax.faces.FacesException(Can't instantiate class rambo.impl.VideoServiceImpl), javax.faces.el.EvaluationException
#{Components["rambo.api.VideoService"]}
? – jmj