複合コンポーネントがあります:
<composite:interface>
<composite:attribute name="actionMethod"
method-signature="java.lang.String action()" required="true" />
</composite:interface>
<composite:implementation>
<h:form>
<h:commandButton id="captureButton" value="#{msgs.capture}"
action="#{cc.attrs.actionMethod}" />
</h:form>
</composite:implementation>
そして、その複合コンポーネントを呼び出しているページ:
<ezcomp:captureTitle actionMethod="#{saveDecisionsBean.captureTitle}" />
およびアクションを含むBean:
@Named(value="saveDecisionsBean")
@SessionScoped
public class SaveDecisionsBean extends BackingBeanBase {
...
public String captureTitle() {
...
}
}
これが私の問題です。これを実行しようとすると、SaveDecisionsBeanにプロパティcaptureTitleがないというメッセージが表示されます。したがって、SaveDecisionsBean#getCaptureTitle()
メソッドを追加する必要があります。私がこれを行うとき、それはうまく動作します。なぜこのメソッドを定義する必要があるのですか?それは<composite:attribute />
メソッドであり、アクションとして使用されるということです。
これが私が得ている正確なエラーメッセージです:
javax.el.PropertyNotFoundException: /index.xhtml @54,86
actionMethod="#{saveDecisionsBean.captureTitle}":
The class 'com.example.persistence.SaveDecisionsBean_$$_javassist_209'
does not have the property 'captureTitle'.
(SEOの理由で:他の実装ではクラス名が表示される場合がありWeldClientProxy
ます。)