分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 前端开发

Invalid tld file: "/WEB-INF/tags/xxxt.tld", see JSP 2.2 specification section 7.3.1 for more details

发布时间:2023-09-06 01:27责任编辑:林大明关键词:暂无标签

错误描述

在jsp页面引入了自定义的TLD文件的时候,碰到了一个错误

Invalid tld file: "/WEB-INF/tags/xxxt.tld", see JSP 2.2 specification section 7.3.1 for more details

错误原因

不符合 JSP2.2 中对tags的规定。
规定说的是这个:

In the jsp-2_2JSP.7.3.1 Identifying Tag Library Descriptors 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.the .tld file can't be in classes , lib ,tags folder or subfolder.

意思是说,如果你使用的是jsp2.2就不能把tld文件放在 /WEB-INF/tags 以及其子目录下。
jsp版本和tomcat的版本是相关的。jsp版本和tomcat的版本对应关系如下:

Servlet SpecJSP SpecEL SpecWebSocket SpecJASPIC SpecApache Tomcat VersionLatest Released VersionSupported Java Versions
4.02.33.01.11.19.0.x9.0.1 (beta)8 and later
3.12.33.01.11.18.5.x8.5.237 and later
3.12.33.01.1N/A8.0.x (superseded)8.0.47 (superseded)7 and later
3.02.22.21.1N/A7.0.x7.0.826 and later(7 and later for WebSocket)
2.52.12.1N/AN/A6.0.x (archived)6.0.53 (archived)5 and later
2.42.0N/AN/AN/A5.5.x (archived)5.5.36 (archived)1.4 and later
2.31.2N/AN/AN/A4.1.x (archived)4.1.40 (archived)1.3 and later
2.21.1N/AN/AN/A3.3.x (archived)3.3.2 (archived)1.1 and later

详情可查看:http://tomcat.apache.org/whichversion.html

解决办法

1.如果你的tld文件放在 /WEB-INF/tags目录下,而你不想改代码,那么,把tomcat换成apache-tomcat-7.0.55 或者以下的版本。(亲测可行)
2.如果你不想换tomcat就把 tld放在 /WEB-INF下。

Invalid tld file: "/WEB-INF/tags/xxxt.tld", see JSP 2.2 specification section 7.3.1 for more details

原文地址:http://www.cnblogs.com/demingblog/p/7919841.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved