Migration to JBoss EAP 7: Custom tags with myfaces2.2.12 and tomahawk20-1.1.14 are not processed and just pasted in html source as String

Posted on

I am trying to migrate/upgrade legacy application based on Myfaces 1.1 with tomahawk to JBoss EAP 7.

EAP 7 requires minimum JSF 2 version for which I have installed/configured myfaces2.2.12 to JBoss EAP 7 using Redhat guide

https://docs.jboss.org/author/display/WFLY10/JSF+Configuration#JSFConfiguration-ConfiguringaJSFapptouseanondefaultJSFimplementation

And can see that my JBoss EAP 7 has successfully recognized the myfaces and now myfaces is default JSF implementation. This is also evident by fact that out of box tags are rendered fine on my pages.

My Custom components TLD is like

<!DOCTYPE taglib
        [
        <!ENTITY html_anchor_attributes      SYSTEM "entities/html_anchor_attributes.xml">
        ]>
<taglib xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
    version="2.1">

    <!-- ============== Tag Library Description Elements ============= -->
    <display-name>
        UI Faces components.
    </display-name>
    <tlib-version>0.1</tlib-version>
    <!-- <jsp-version>2.3</jsp-version> -->
    <short-name>CC</short-name>
    <uri>http://com.xxx.faces.components/tld/standard_ui.tld</uri>
    <tag>
        <name>outputLink</name>
        <tag-class>com.xxx.faces.components.taglib.OutputLinkTag</tag-class>
        <body-content>tagdependent</body-content>
        &html_anchor_attributes;
    </tag>
</taglib>

Java code for OutputLinkTag.class is

package com.xxx.faces.components.taglib;

public class OutputLinkTag extends org.apache.myfaces.taglib.html.HtmlOutputLinkTag //UIComponentBodyTag
{
    public String getComponentType()
    {
        return "javax.faces.Output";
    }

    public String getRendererType()
    {
        return "com.xxx.faces.components.OutputLink";
    }
}

In JSP code I am using

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://com.xxx.faces.components/tld/standard_ui.tld" prefix="d" %>
<html><body>....
<d:outputLink id="helpLink" value="/tests/link/help.jsf">
    <h:outputText value="Help!"/>
</d:outputLink>
</body></html>

In logs I see no exceptions or erros though I got message like

org.apache.myfaces.shared.renderkit.RendererUtils (default task-3) the created converter is null
org.apache.myfaces.shared.renderkit.RendererUtils (default task-3) returning an .toString
org.apache.myfaces.shared.renderkit.html.HtmlTextRendererBase (default task-3) renderOutput '

And the output HTML is like

<html><body>....
<d:outputLink id="helpLink" value="/tests/link/help.jsf">
    <h:outputText value="Help!"/>
</d:outputLink>
</body></html>

As browser do not understand how to render these tag, page looks empty but in html source I can see the above code.