1
votes

I am trying to implement pagination in JSF and Hibernate.

I have these statements on my html page.

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" 
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
xmlns:t="http://myfaces.apache.org/tomahawk">

<t:dataList value="#{med.pages}" var="page">

I have included tomahawk20-1.1.14-bin - the jar files in /build/web/WEB-INF/lib and tomahawk-examples-1.1.14-bin - all the war files in /build/web/WEB-INF/src/META-INF

But, I get this error : Unable to find or serve resource, dataList.xhtml, from library, org.apache.myfaces.custom. What should I do ?

2
Some web servers (apache, weblogic) already contain the JSF libraries. If you try to include them again, the server container will give an error.Erick

2 Answers

1
votes

I think it is caused by Mojarra (it gets confused reading the .taglib.xml, even if is valid syntax to use that file for composite and normal components, it was clarified in the new 2.2 spec) Use MyFaces JSF implementation instead to get it fixed.

1
votes

I believe this is a tomahawk issue. The JSF 2.2 spec mentions this:

As specified in facelet taglibrary schema, the runtime must also support the composite-library-name element. The runtime must interpret the contents of this element as the name of a resource library as described in Section 2.6.1.4 “Libraries of Localized and Versioned Resources”. If a facelet tag library descriptor file is encountered that contains this element, the runtime must examine the element in that same tag library descriptor and make it available for use in an XML namespace declaration in facelet pages.

And there's also this in the spec:

If you want to employ a cc with a namespace other than http://java.sun.com/jsf/composite/libraryName you need to have a taglib file that declares composite-library-name. Currently you must not declare any tag elements in such a taglib file. All the tags in such a library must come from the same resource library.

In the case of tomahawk, composite-library-name does not point to a resource (a directory name under META-INF/resources), hence the errors.

The simple solution here may be to remove the composite-library-name element from the tomahawk.taglib.xml file (if it's not needed for any other purpose of course). I haven't tested it however.