gpt4 book ai didi

Java 错误 : message Invalid tld file: see JSP 2. 2 规范第 7.3.1 节了解更多详细信息

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:05:21 35 4
gpt4 key购买 nike

访问本地java tomcat页面时出现如下错误,请帮忙检查一下是什么问题,谢谢

jsp代码

<%@ taglib prefix="p" uri="/WEB-INF/classes/tld/pagertag.tld"%>

错误日志:

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Invalid tld file: "/WEB-INF/classes/tld/pagertag.tld", see JSP 2.2 specification section 7.3.1 for more details

at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:117)
at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:347)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:154)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:419)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:484)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1421)
at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)

最佳答案

根据文档

Tag library descriptor files have names that use the extension .tld, and the extension indicates a tag library descriptor file. When deployed inside a JAR file, the tag library descriptor files must be in the META-INF directory, or a subdirectory of it. When deployed directly into a web application, the tag library descriptor files must always be in the WEB-INF directory, or some subdirectory of it. TLD files should not be placed in /WEB-INF/classes or /WEB-INF/lib, and must not be placed inside /WEB-INF/tags or a subdirectory of it, unless named implicit.tld and intended to configure an implicit tag library with its JSP version and tlib-version.

您可以将您的标签库放在 WEB-INF/tags 中并重命名为 implicit.tld

关于Java 错误 : message Invalid tld file: see JSP 2. 2 规范第 7.3.1 节了解更多详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38593625/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com