バックグラウンド
マネージド Bean には、その web.xml ファイルを介して構成されたパラメーターが必要です。web.xml ファイルでは、JDeveloper (11.1.2.3)で構成されるコンテキスト初期化パラメータが次のように定義されています。
定義のソースは次のreporting.server.protocol
とおりです。
<context-param>
<description>Defines the data transport mechanism to ret...</description>
<param-name>reporting.server.protocol</param-name>
<param-value>http</param-value>
</context-param>
Bean は、 のパブリック アクセサ メソッドを公開しますreportServerProtocol
。
Bean のソースは次のようになります。
@ManagedBean
@RequestScoped
public class OracleReportBean extends ReportBean {
@ManagedProperty("#{initParam['reporting.server.protocol']}")
private String reportServerProtocol = URLReportImpl.DEFAULT_PROTOCOL;
// ...
}
問題
FacesContextではなく、コンテキスト初期化パラメーターを使用して Bean を初期化したいと思います。(adfc-config.xml
注: ではありませんfaces-confg.xml
) では、いくつかの例で への参照が示されていinitParam
ます。
<managed-bean>
<managed-bean-name>reportBean</managed-bean-name>
<managed-bean-class>ca.corp.report.view.OracleReportBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>reportServerProtocol</property-name>
<property-class>java.lang.String</property-class>
<value>#{initParam['reporting.server.protocol']}</value>
</managed-property>
...
</managed-bean>
値要素であるキー行#{initParam['reporting.server.protocol']}
。ただし、JDeveloper はその行を正しくないと表示します。つまり、initParam
コンテキストは 内では使用できませんadfc-confing.xml
。
エラーは、「EL トークンinitParam
が不明です」です。
質問
ELを使用して、ADFc内で宣言的にマネージドBeanを構成するためにコンテキスト初期化パラメータをどのように使用できますか?
関連リンク
- @ManagedProperty アノテーションを介してマネージド Bean 全体を注入する方法は?
- http://balusc.blogspot.ca/2011/09/communication-in-jsf-20.html
- https://stackoverflow.com/tags/el/info
- http://www.oracle.com/technetwork/developer-tools/adf/learnmore/43-remote-task-flow-169185.pdf
- http://docs.oracle.com/cd/E25178_01/web.1111/b31974/taskflows_activities.htm