Forum Stats

  • 3,751,328 Users
  • 2,250,341 Discussions
  • 7,867,384 Comments

Discussions

custom tab libraries doesn't work after upgrading JSFand facelets

843844
843844 Member Posts: 40,416
edited May 13, 2010 1:22PM in JavaServer Faces
The custom tag libraries in my application are not working after I upgraded JSF and facelet versions in my development environment . I have custom taglibs defined in a taglib file and that file is added as value of a context param in web.xml. see below
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/META-INF/tags/wizard.taglib.xml;</param-value>
</context-param>
The file wizard.taglib.xml has custom tags defined as below.
<facelet-taglib>
<namespace>http://www.tolven.org/jsf/wizard</namespace>
<tag>
<tag-name>body</tag-name>
<source>wizard/body.xhtml</source>
</tag>
.......
and I have my .xhtml file using the taglibs
<!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:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:wiz="http://www.tolven.org/jsf/wizard">
<head>
    <title>New Wizard</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
      here is the content
    <ui:composition>
		<wiz:step title="Start">
...................
</wiz:step>
Old Environment
============
facelets-1.1.12
JSF1.2
JBoss 4GA

New Environment:
==============
facelets-1.1.15-jsf1.2.zip
Glassfish V3
JSF2.0

It was working fine until I ported code to glassfish which has upgraded version of JSF2 and facelets. Now I see the custom taglibs are displayed as it is in the HTML page. Any help fixing this will be appreciated. Thank you.

Comments

  • 843844
    843844 Member Posts: 40,416
    I think I found the problem and the solution(which is not 100% correct). The context param should be facelets.LIBRARIES not javax.faces.FACELETS_LIBRARIES.

    the context param 'javax.faces.FACELETS_LIBRARIES' is supposed to replace the deprecated(deprecated as per JSF) context param facelets.LIBRARIES. When the latter is used there is a warning in the logs during server startup saying facelets.LIBRARIES is deprecated and javax.faces.FACELETS_LIBRARIES should be used instead. But I think this is only used for logging a warning, i.e. still the name facelets.LIBRARIES is used to build custom taglib components. I'm saying this is not 100% correct because it should work with the new parameter name. There are other parameters which have got new names, but I didn't test them yet.



    -Srini.
  • RayDeCampo
    RayDeCampo Member Posts: 2,977
    I would encourage you to file a bug report against the JSF implementation you are using.
This discussion has been closed.