Java Struts - 所有 .tld 文件都位于哪个 jar 文件中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2388133/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 06:51:27  来源:igfitidea点击:

Struts - In which jar file all the .tld files located

javastruts2strutsstruts-html

提问by Yatendra Goel

I am developing a Strutsbased web application. I am new to Struts. I want to use struts-html.tld taglib, provided by struts, in my jsp pages.

我正在开发一个Struts基于 Web 的应用程序。我是新手Struts。我想struts-html.tld taglib在我的 jsp 页面中使用由 struts 提供的 。

When I searched on net, I came to know that prior to Struts 1.2.9, we need to locate the .tldfiles manually.

当我在网上搜索时,我才知道在 之前Struts 1.2.9,我们需要.tld手动定位文件。

But now these .tldfiles are packed in .jar files and we need to just use those jar files as any other jar file in our project.

但是现在这些.tld文件被打包在 .jar 文件中,我们只需要像使用我们项目中的任何其他 jar 文件一样使用这些 jar 文件。

Q1. So my question is in Which jar file these .tldfiles are located. I came to know from a Javaranchanswer that these .tldfiles are packed into struts-taglib.jarfile. I downloaded the full struts libraries but didn't find that jar file.

一季度。所以我的问题是这些.tld文件位于哪个 jar文件中。我从一个Javaranch答案中得知这些.tld文件被打包到struts-taglib.jarfile.txt 中。我下载了完整的 struts 库,但没有找到那个 jar 文件。

采纳答案by Pascal Thivent

It's not clear which version of Struts you're using but the TLD you are referring to is a Struts 1 TLD.

不清楚您使用的是哪个版本的 Struts,但您所指的 TLD 是 Struts 1 TLD。

In Struts 1.3.10, it is bundled in struts-taglib-1.3.10.jar/META-INF/tld/struts-html.tldwhich is distributed in struts-1.3.10-lib.zip. In Struts 1.2.9, you'll find it in the root of struts-1.2.9-lib.zip.

在 Struts 1.3.10 中,它被捆绑在struts-taglib-1.3.10.jar/META-INF/tld/struts-html.tld其中,分布在struts-1.3.10-lib.zip. 在 Struts 1.2.9 中,您会在struts-1.2.9-lib.zip.

Just in case, note that Struts 2 uses a completely different tag library than Struts 1 and there is only one taglib instead of several. The corresponding TLD is located in struts2-core-2.1.8.1.jar/META-INF/struts-tags.tld.

以防万一,请注意 Struts 2 使用与 Struts 1 完全不同的标签库,并且只有一个标签库而不是多个。相应的 TLD 位于struts2-core-2.1.8.1.jar/META-INF/struts-tags.tld.

回答by Marcus Leon

I looked in one of our projects using Struts. I can see this tld file: struts2-core-j4-2.0.11.jar\META-INF\struts-tags.tld

我使用 Struts 查看了我们的一个项目。我可以看到这个 tld 文件:struts2-core-j4-2.0.11.jar\META-INF\struts-tags.tld

Note you can search through Jar files using Windows search. See hereif you're having issues searching.

请注意,您可以使用 Windows 搜索来搜索 Jar 文件。如果您在搜索时遇到问题,请参阅此处

回答by Buhake Sindi

Download the Full Distributionof Strutsand find the struts-blank.warin the archive. Extract the struts-blank.war and under the WEB-INFfolder, copy all the .tldfiles into your WEB-INFfolder.

下载完整发行Struts的,找到的struts-blank.war在档案中。解压 struts-blank.war 并在WEB-INF文件夹下,将所有.tld文件复制到您的WEB-INF文件夹中。

回答by Pranab sankar Nayak

struts2-core-2.2.1.1.jarwill contain the TLD file at the following location struts2-core-2.2.1.1.jar/META-INF/struts-tags.tld

struts2-core-2.2.1.1.jar将在以下位置包含 TLD 文件 struts2-core-2.2.1.1.jar/META-INF/struts-tags.tld