2011-05-01 108 views
2

我注入的Spring bean到JSF豆, 導致javax.faces.FacesException(不能實例化類), javax.faces.el.E​​valuationException關於注入的Spring bean到JSF豆

時遇到了一個問題一個問題

這裏是我的xml文件:

文件WEB-INF/components.xml中定義的Spring bean

<beans> 
    <bean id="rambo.api.VideoService" 
    class="rambo.impl.VideoServiceImpl"> 

      <!-- some properties ... --> 
    </bean> 
</beans> 

文件WEB-INF/faces-config.xml中定義的JSF豆

<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> 

文件videoMain.jsp:

在resourceToolExists:在videoBean使用videoService

的一些方法
<h:panelGroup rendered="#{! videoBean.resourceToolExists" > 
    <%@ include file="videoNoResource.jsp" %> 
</h:panelGroup> 

這裏得到: javax.faces.FacesException(無法實例類rambo.impl .VideoServiceImpl), javax.faces.el.E​​valuationException

+0

是什麼'#{組件[「rambo.api.VideoService」]}'? – 2011-05-02 05:43:28

回答