Nested composite component, broken into JBoss 7.1.1

We use composite components inside other components in our project. Everything works fine on JBoss 7.1.0 , but on JBoss 7.1.1 we get errors like this:

No handlers found for exception javax.faces.view.facelets.TagException: /resources/components/my/bigComponent.xhtml @21,47 <my:nestedComponent> Tag Library supports namespace: http://java.sun.com/jsf/composite/components/my, but no tag was defined for name: nestedComponent 

We tried the solution proposed in this community of the JBoss community , but it did not change anything to our problem (we are not the only seams in this case , and the solution may not work, because we are also in the ui:define tag from the template file).

Here are two of our components:

Nesting:

 <!DOCTYPE html PUBLIC ...> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:cc="http://java.sun.com/jsf/composite" xmlns:my="http://java.sun.com/jsf/composite/components/my" > <cc:interface componentType="..."> <h:panelGroup> <cc:attribute name="someAttribute" /> </h:panelGroup> </cc:interface> <cc:implementation> <my:nestedComponent content="a text" /> </cc:implementation> </html> 

Nested:

 <!DOCTYPE html PUBLIC ...> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:cc="http://java.sun.com/jsf/composite"> <cc:interface> <cc:attribute name="content" /> </cc:interface> <cc:implementation> <h:outputText value="#{cc.attrs.content}" /> </cc:implementation> </html> 

Is this a regression? Are we doing something wrong? In the 1st link, the proposed solution implies something like this in the nesting component:

 <composite:interface> <composite:facet name="greet1"/> <composite:facet name="greet2"/> </composite:interface> <composite:implementation> <lib:greet1 name="Stan" /> <lib:greet2 name="Silvert" /> </composite:implementation> 

What is this composite:facet without composite:renderFacet for?

+4
source share
2 answers

Valentinx found a workaround to this thread .

The idea is to put erroneous namespace declarations in <composite:implementation> , so

 <!DOCTYPE html PUBLIC ...> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:cc="http://java.sun.com/jsf/composite" xmlns:my="http://java.sun.com/jsf/composite/components/my" > <cc:interface /> <cc:implementation> <my:nestedComponent content="a text" /> </cc:implementation> </html> 

becomes

 <!DOCTYPE html PUBLIC ...> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:cc="http://java.sun.com/jsf/composite" > <cc:interface /> <cc:implementation xmlns:my="http://java.sun.com/jsf/composite/components/my"> <my:nestedComponent content="a text" /> </cc:implementation> </html> 

(note the <cc:implementation xmlns:my="http://java.sun.com/jsf/composite/components/my"> )

It works like a charm!

+9
source

Thanks to Xavier for the answer: it's right! I wanted to add a comment, but have no reputation. for this.

In my case, the problem is a little difference, with an error in the template (not in the composite: implementation), and I found a solution that does not include <cc: implementation> ...

Instead, xmlns: layoutComp in the template was moved from <html> to the container (both "div" and "span" worked):

 <span xmlns:layoutComp="http://java.sun.com/jsf/composite/layoutComp"> <layoutComp:navigation /> </span> 
0
source

Source: https://habr.com/ru/post/1401784/


All Articles