Note that there are some explanatory texts on larger screens.

plurals
  1. POJSF2 composite component throws PropertyNotFoundException for action method
    primarykey
    data
    text
    <p>I have a composite component:</p> <pre><code>&lt;composite:interface&gt; &lt;composite:attribute name="actionMethod" method-signature="java.lang.String action()" required="true" /&gt; &lt;/composite:interface&gt; &lt;composite:implementation&gt; &lt;h:form&gt; &lt;h:commandButton id="captureButton" value="#{msgs.capture}" action="#{cc.attrs.actionMethod}" /&gt; &lt;/h:form&gt; &lt;/composite:implementation&gt; </code></pre> <p>and a page which is calling that composite component:</p> <pre><code>&lt;ezcomp:captureTitle actionMethod="#{saveDecisionsBean.captureTitle}" /&gt; </code></pre> <p>and a bean which contains the action:</p> <pre><code>@Named(value="saveDecisionsBean") @SessionScoped public class SaveDecisionsBean extends BackingBeanBase { ... public String captureTitle() { ... } } </code></pre> <p>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 <code>SaveDecisionsBean#getCaptureTitle()</code> method. When I do this, it runs just fine. Why should I have to define this method? It says in the <code>&lt;composite:attribute /&gt;</code> that it's a method, and it's used as an action.</p> <p>Here is the exact error message I'm getting: </p> <pre class="lang-none prettyprint-override"><code>javax.el.PropertyNotFoundException: /index.xhtml @54,86 actionMethod="#{saveDecisionsBean.captureTitle}": The class 'com.example.persistence.SaveDecisionsBean_$$_javassist_209' does not have the property 'captureTitle'. </code></pre> <p>(For SEO reasons: other implementations might show class name <code>WeldClientProxy</code>.) </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload