我尝试按照http://seamframework.org/Documentation/CreatingCustomELFunctions
在seam 2.2中创建自定义el函数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)
使用JSF 1.2
在web.xml中使用以下参数。
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>
/WEB-INF/elfunctions.taglib.xml
</param-value>
</context-param>
答案 0 :(得分:0)
映射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>
将它放在你的类路径中,它将在web.xml中没有任何内容工作