【问题标题】:Unable to find taglib[min] for URI找不到 URI 的 taglib [min]
【发布时间】:2018-09-14 09:44:00
【问题描述】:

我对自制标签有疑问。我收到以下错误

org.apache.jasper.JasperException: 无法找到 taglib [mine] for URI:[随机事物] org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:55) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:294) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:81)...

这里也是错误的图片

但我认为 jsp-File 中的所有内容都是正确的。这是代码

...

<%@ taglib prefix="mine" uri="randomThings"%> 
Advisor Page<br> 
<mine:advice user="${userName}" /> 

...

这是我在WEB-INF中部署的tld文件

 <tlib-version>1.2</tlib-version> 

 <short-name>RandomTags</short-name> 

 <uri>randomThings</uri> 

 <tag>          
<description>random advice</description> 
    <name>advice</name>     
<tag-class>com.example.model.AdvisorTagHandler</tag-class> 
    <body-content>empty</body-content>
<attribute> 
 <name>user</name>          
  required>true</required>
  <rtexprvalue>true</rtexprvalue>   
</attribute>
</tag>
</taglib>

【问题讨论】:

  • 如果您需要任何其他信息,请告诉我
  • 除此之外,请将图像作为代码包含在内,因为图像无法搜索,而且点击次数过多,无法看到。
  • 你是对的。我已经把重要的错误堆栈放在了开头

标签: java jsp jakarta-ee


【解决方案1】:

改变uri的

<%@ taglib prefix="mine" uri="randomThings"%>

<%@ taglib prefix="mine" uri="WEB-INF/custom.tld"%>

custom.tld 是 tld 文件的名称)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-03
    • 1970-01-01
    • 2010-10-25
    • 1970-01-01
    • 1970-01-01
    • 2012-04-21
    • 2012-02-20
    • 1970-01-01
    相关资源
    最近更新 更多