开发者

Error in creating Seam Custom EL function

开发者 https://www.devze.com 2023-04-05 19:47 出处:网络
I tried to create a custom el function in seam 2.2 by following http://seamframework.org/Documentation/CreatingCustomELFunctions

I tried to create a custom el function in seam 2.2 by following http://seamframework.org/Documentation/CreatingCustomELFunctions

The taglib content is:

<?xml version="1.0"?>
<!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "facelet-taglib_1_0.dtd">
<facelet-taglib>
     <library-class>org.el.func.FnLibrary</library-class>
</facelet-taglib>

But while running, getting the following parsing error.

SEVERE [compiler] Erro开发者_开发百科r Loading Library: vfszip:/home/anand/jboss-5.1.0.GA/server/default/deploy/stagebitz.ear/stagebitz.jar/META-INF/elfunctions.taglib.xml
java.io.IOException: Error parsing [vfszip:/home/anand/jboss-5.1.0.GA/server/default/deploy/stagebitz.ear/stagebitz.jar/META-INF/elfunctions.taglib.xml]: 


Caused by: org.xml.sax.SAXException: Error Handling [vfszip:/home/anand/jboss-5.1.0.GA/server/default/deploy/stagebitz.ear/stagebitz.jar/META-INF/elfunctions.taglib.xml@4,57] <library-class>

at com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java:271)

Using JSF 1.2

In web.xml used following parameters.

 <context-param>
      <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
      <param-value>
        /WEB-INF/elfunctions.taglib.xml
    </param-value>
   </context-param>


Example to map isEmpty:

<!DOCTYPE facelet-taglib PUBLIC
        "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
        "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
     <namespace>yournamespace</namespace>
    <function>
        <function-name>functionname</function-name>
        <function-class>fullclanmae</function-class>
        <function-signature>java.lang.Boolean isEmpty(java.util.Set)</function-signature>
    </function>
</facelet-taglib>

Put it in your classpath, and it will work withouth anything in web.xml

0

精彩评论

暂无评论...
验证码 换一张
取 消