これを使用して、EL Expression で定義されているマネージド Bean メソッドを呼び出す必要があります。EL式を使用してマネージドBeanメソッドを呼び出す方法のような例はありますか?
ここでは、マネージド Bean の種類がわかりません。しかし、私はEL式を知っています。そのため、特定のマネージド Bean に型キャストすることはできません。
式は次のとおりです。#{phaseListenerBean.compListener}
compListener
コードでメソッドを呼び出すにはどうすればよいphaseListenerBean
ですか? 私のユーティリティクラス。Jarファイルで利用できます。
`public void beforePhase(PhaseEvent イベント) { if(PhaseId.RENDER_RESPONSE.equals(event.getPhaseId())){ SystemListLoaderHelper.populateSelectOneValidValues();
SystemListLoaderHelper.populateSelectManyCheckboxValidValues();
FacesContext context = FacesContext.getCurrentInstance();
ExpressionFactory factory =context.getApplication().getExpressionFactory();
MethodExpression methodExpression = factory.createMethodExpression(
context.getELContext(), "#{phaseListenerBean.callModuleSpecificServiceCalls}",
Void.class.getClass(), null);
methodExpression.invoke(context.getELContext(), null);
// callModuleSpecificServiceCalls(); } }`