I have a composite component:
<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>
and a page which is calling that composite component:
<ezcomp:captureTitle actionMethod="#{saveDecisionsBean.captureTitle}" />
and a bean which contains the action:
@Named(value="saveDecisionsBean")
@SessionScoped
public class SaveDecisionsBean extends BackingBeanBase {
...
public String captureTitle() {
...
}
}
Now here is my problem. When I try to run this, it says that SaveDecisionsBean doesn't have a property captureTitle. Therefore, I have to add a SaveDecisionsBean#getCaptureTitle()
method. When I do this, it runs just fine. Why should I have to define this method? It says in the <composite:attribute />
that it's a method, and it's used as an action.
Here is the exact error message I'm getting:
javax.el.PropertyNotFoundException: /index.xhtml @54,86
actionMethod="#{saveDecisionsBean.captureTitle}":
The class 'com.example.persistence.SaveDecisionsBean_$$_javassist_209'
does not have the property 'captureTitle'.
(For SEO reasons: other implementations might show class name WeldClientProxy
.)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…