Problem
I am using JSF 2.1.13
to create a prototype to demostrate the benefits of JSF over our current webapp built with JSP
and struts 1.1
. I following code using works with JSF 2.2.6
, but I had to down grade once I found out that Oracle Weblogic 12c doesn't support JSF 2.2 yet. When running the code with 2.1.13 I receive the following error:
/pages/sites/tab-details.xhtml @27,90 <ccc:codedType> Tag Library supports namespace: http://java.sun.com/jsf/composite/ccc, but no tag was defined for name: codedType
Googling only pointed me to a bug about nested composite components, but that isn't something I'm doing.
Code
Excerpt from pom.xml
<!-- JSF Dependencies -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.13</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.13</version>
</dependency>
Composite Compontent: webapp/WEB-INF/resources/ccc/codedType.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<ui:component xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:cc="http://java.sun.com/jsf/composite">
<cc:interface shortDescription="Renders a CodedType">
<cc:attribute name="value" required="true"
shortDescription="Instance of CodedType to be properly rendered"
type="company.prototype.uireplacement.presenter.CodedType" />
<cc:attribute name="includeCode"
shortDescription="Whether or not the rendeder type should include the code"
type="boolean" default="false"/>
</cc:interface>
<cc:implementation>
<span id="#{cc.attrs.id}">#{cc.attrs.value.label}<ui:fragment rendered="#{cc.attrs.includeCode}"> (#{cc.attrs.value.code})</ui:fragment></span>
</cc:implementation>
</ui:component>
Page using composite component: webapp/pages/sites/tab-details.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:ccc="http://java.sun.com/jsf/composite/ccc">
<ccc:codedType value="#{siteControllerBean.selectedSite.type}" includeCode="true"/>
</ui:composition>