0

まず、私のコード:

report-layout.xhtml:

<ui:define name="content">
    <h:panelGroup id="reporte-viewer" layout="block" >
        <p:media value="#{reportBean.file}" player="pdf" width="500px" height="400px">
            NO SUPP!!!
        </p:media>
    </h:panelGroup>
</ui:define>

index.xhtml:

<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
             ..............
             template="/WEB-INF/template/layouts/report-layout.xhtml">

    <ui:param name="reportBean" value="#{myBean}" />

</ui:composition>

MyBeanをViewScopedとSessionScopedでテストしましたが、getValueを使用すると次のコードがnullを返します。

PrimeResourceHandler.java:

String dynamicContentEL = (String) session.get(dynamicContentId); //read: "#{reportBean.file}" replacing with "#{myBean.file}" works.
ELContext eLContext = context.getELContext(); //OK
ValueExpression ve = context.getApplication().getExpressionFactory().createValueExpression(eLContext, dynamicContentEL, StreamedContent.class); //Apparently OK
streamedContent = (StreamedContent) ve.getValue(eLContext); //return null

param getValue return nullのようにMyBeanを渡すと、JSFは「#{reportBean.file}」を問題なく解決しますが、beforeコードが機能しないのはなぜですか。

4

0 に答える 0