我正在尝试在 myTld.tld 文件中定义一个函数,例如
<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.1" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd">
<tlib-version>1.0</tlib-version>
<short-name>customFunctions</short-name>
<uri>/WEB-INF/tags/myTld.tld</uri>
<function>
<description>
my Desc
</description>
<name>isActive</name>
<function-class>com.Functions</function-class>
<function-signature>boolean isActive()</function-signature>
</function>
</taglib>
从 El 脚本我打电话给喜欢
<%@ taglib prefix="customFunctions" uri="/WEB-INF/tags/myTld.tld"%>
${customFunctions:isActive()}
每次我这样做,我都会得到
Invalid syntax for function signature in TLD. Tag Library: customFunctions, Function: isActive