2013-01-22 2 views
1

배경

관리 bean은 web.xml 파일을 통해 매개 변수를 구성해야합니다.관리 Bean의 컨텍스트 초기화 매개 변수

enter image description here

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> 

빈 드러내는를 web.xml 파일은 JDeveloper의 (11.1.2.3)에 구성된 콘텍스트 초기화 파라미터로는 다음을 정의 reportServerProtocol의 공용 접근 메서드

빈의 소스 유사합니다

@ManagedBean 
@RequestScoped 
public class OracleReportBean extends ReportBean { 

    @ManagedProperty("#{initParam['reporting.server.protocol']}") 
    private String reportServerProtocol = URLReportImpl.DEFAULT_PROTOCOL; 

    // ... 
} 

문제

차라리 FacesContext을 통해보다 컨텍스트 초기화 매개 변수를 사용하여 빈을 초기화하고 싶습니다

. 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 내에서 관리 빈을 구성 할 수 있습니다?

관련 링크 당신이 시도 할 수있는 UI 계층에서

답변

1

JDeveloper의의 버그가 오류가 표시됩니다는 예상대로

JDeveloper Error

그러나, IDE가 오류를 표시하더라도, 코드가 실행됩니다.

0

이 같은 :

<c:set target="${BeanName}" property="PropertyName" value="${true}"/>