当我尝试映射自定义标签,我得到Error: 500
有消息File "/customTag" not found
错误在JSP中映射自定义标签
这里是我的尝试: myTag.tld
<taglib version="2.0" xmlns="http://java.sun.com/xml/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
>
<uri>customTag</uri>
<tlib-version>1.0</tlib-version>
<tag>
<name>multiplier</name>
<tag-class>myPack.MultiplierTag</tag-class>
<attribute>
<name>input</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>
jsp页面
<%@taglib uri="/customTag" prefix="operator"%>
<%
String input = request.getParameter("input");
%>
<operator:multiplier input="<%=input%>"></operator:multiplier>
当我试图使用文件名访问.tld
文件,那么一切都很好
只是猜测,但既然你有' customTag '然后也许尝试'<%@ taglib uri =“customTag”前缀=“运营商”%>'没有'/'customTag'前。 –
Pshemo
@Pshemo即使这不起作用。我试过 – guptakvgaurav