2012-01-05 4 views
0

OpenFacesでRichFacesをツリーテーブルに組み込もうとしていて、展開の折りたたみボタンが表示されていないとき。 jの一部がロードされていないことが判明しました。次のようにopenfacesツリーテーブルのjsがありません

JSFコードは:

<o:treeTable var="o"> 
         <o:dynamicTreeStructure nodeChildren="#{bean.originNodeChildren}" 
               nodeHasChildren="#{bean.originHasChildren()}"/> 
         <o:treeColumn expandedToggleImageUrl="/img/toggle-expand-light.png" 
             collapsedToggleImageUrl="img/toggle-collapse-light.png"> 
          <h:outputText value="#{o.description}"/> 
         </o:treeColumn> 
        </o:treeTable> 

Beanコード(hasChildren法を含む)が正しくトリガされています。

JSの例外:

Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/util/ajaxUtil-2.1.EA1.1143.js) 
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/util/util-2.1.EA1.1143.js) 
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/tableUtil-2.1.EA1.1143.js) 
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/table/table-2.1.EA1.1143.js) 
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/table/treeTable-2.1.EA1.1143.js) 

OpenFacesバージョン2.0とRichFacesのバージョン3.3.3を使用しました。

答えて

1

web.xmlで開いている顔のリソースフィルタを設定する必要があり、ジョブが完了しています。次のようなものがあります。

public class OpenFacesResourceFilter extends ResourceFilter { 
    // -- Fields -- 

    // -- Methods -- 
    @Override 
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { 
     try{ 
      super.doFilter(servletRequest, servletResponse, filterChain); 
     } catch (ServletException e) { 
      Throwable parent = e.getCause(); 
      if(parent!=null && parent instanceof ServletException) { 
       throw (ServletException) parent; 
      } else { 
       throw e; 
      } 
     } 
    } 
} 
0

これは、アプリケーションのxmlファイルにOpenFacesリソースフィルタが実際に宣言されていないようです。ここでは、フィルタを宣言することができる方法についてのドキュメントからの抜粋は(あなた自身をフィルタリングし、このため任意のJavaクラスを作成する必要はありませんのでご注意)です。

<!-- FILTER FOR PROCESSING INTERNAL OPENFACES RESOURCES --> 
    <filter> 
    <filter-name>ResourceFilter</filter-name> 
    <filter-class>org.openfaces.util.ResourceFilter</filter-class> 
    </filter> 

    <!-- MAPPING FOR OPENFACES RESOURCE FILTER --> 
    <filter-mapping> 
    <filter-name>ResourceFilter</filter-name> 
    <url-pattern>/*</url-pattern> 
    </filter-mapping> 

Installationセクション、およびOpenFaces 2.0でResource Filter Optimizationのセクションを参照してください。ドキュメンテーション。

+0

わかりました。 –

関連する問題