I was trying to create a composite component based on BalusC's excellent article. I couldn't get the attributes or any value from the backing component. Code:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface componentType="test">
<composite:attribute name="something" />
</composite:interface>
<composite:implementation>
<h:outputText value="#{composite.attrs.something}" />
<h:outputText value="#{composite.hello}" />
</composite:implementation>
</html>
I found out that the same code works then i use the "cc" namespace instead of "composite". Code:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:cc="http://java.sun.com/jsf/composite">
<cc:interface componentType="test">
<cc:attribute name="something" />
</cc:interface>
<cc:implementation>
<h:outputText value="#{cc.attrs.something}" />
<h:outputText value="#{cc.hello}" />
</cc:implementation>
</html>
The question is, why is it not working with the "composite" namespace? I couldn't find any information that "composite" is a JSF reserved word or something.
Thanks.