Properties of new tags using composite component are not displayed by Eclipse auto complete shortcurt

后端 未结 2 1908
逝去的感伤
逝去的感伤 2020-12-20 18:34

I have developed composite components using JSF 2.0 in Eclipse. I\'ve been putting my XHTML tag files inside resources folder.

When I hit ctrl

2条回答
  •  死守一世寂寞
    2020-12-20 18:50

    I am using Eclipse Mars with Java EE package, Hibernate tools and Spring IDE and I just checked it works out of the box.

    Make sure your component is under webapp/resources/YOUR_COMP_NAME.

    Ignore this, see edition below: Review your header namespace for composite, in your sample code you have

    xmlns:cc="http://xmlns.jcp.org/jsf/composite"
    

    but in my code I have

    xmlns:composite="http://java.sun.com/jsf/composite"
    

    It doesn't mind whether you use cc pr composite prefix, but as you can see, the URL is diferent. See this document

    Finally, when you use this composite into any xhtml page, include it as follows:

    xmlns:prefix="http://java.sun.com/jsf/composite/YOUR_COMP_NAME"
    

    This way, when you write in eclipse and press ctrl + space it will show you the list of components you have.

    Edit

    I have just realized that http://xmlns.jcp.org/jsf/composite is the new URL in substitution of http://java.sun.com/jsf/composite, so I changed it in my code and it already works.

提交回复
热议问题