创建接缝自定义EL功能的错误

发布于 2024-12-05 07:01:48 字数 1474 浏览 0 评论 0原文

我试图通过关注 http://seamframework.org/documentation/creatingingingingingingcustomelfunctions

taglib内容是:

<?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>

但是在运行时,会遇到以下解析错误。

SEVERE [compiler] Error 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)

在Web.xml中使用以下参数中使用JSF 1.2

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

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] Error 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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七禾 2024-12-12 07:01:48

绘制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>

将其放入您的classpath,它将与web.xml中的任何东西一起使用

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文