How to reference value declared in cc:attribute in cc:implementation

后端 未结 1 1682
说谎
说谎 2021-01-25 11:55

I have a simple JSF 2.0 composite component example.



        
相关标签:
1条回答
  • 2021-01-25 12:15

    You need to reference composite component attribute values by #{cc.attrs.<name>} where <name> is the attribute name. So, this should do:

    <h:inputText value="#{cc.attrs.model.vorname}">
    

    See also:

    • Java EE 6 tutorial - Facelets - Composite Components
    • Java EE 6 tutorial - Advanced Composite Components
    • <composite:xxx> tag documentation

    Unrelated to the concrete problem, all that <html><head><body> in the composite is unnecessary. I suggest to use <ui:component> since that's more clear. See also our composite component wiki page for examples.

    0 讨论(0)
提交回复
热议问题