简体   繁体   English

错误 - 找不到“/struts-tags”的标签库描述符

[英]Error - Can not find the tag library descriptor for “/struts-tags”

I'm receiving this error on my jsp file - 'Can not find the tag library descriptor for "/struts-tags"'我在我的 jsp 文件中收到此错误 - '找不到“/struts-tags”的标签库描述符'

Strange thing is my app still seems to work.奇怪的是我的应用程序似乎仍然有效。

I'm following the tutorials at - http://struts.apache.org/2.x/docs/using-struts-2-tags.html我正在关注教程 - http://struts.apache.org/2.x/docs/using-struts-2-tags.html

Here is the code.这是代码。

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> 
<%@ taglib prefix="s" uri="/struts-tags" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
  <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
      <title>Hello World!</title> 
  </head> 
  <body>  
      <h2><s:property value="messageStore.message" /></h2>  
      <p>I've said hello <s:property value="helloCount" /> times!</p>  
      <p><s:property value="messageStore" /></p> 
  </body>
</html>  

Thanks谢谢

Have you added the struts2-core-.jar to the libraries of the project?你有没有将struts2-core-.jar 添加到项目的库中? If you have try to clean the project.如果您尝试清理项目。

In ECLIPSE: Right click on the project and select the option "Validate".在 ECLIPSE 中:右键单击项目并选择“验证”选项。 That's all.仅此而已。

The same thing happened to me.同样的事情发生在我身上。 I am using Maven to compile.我正在使用 Maven 进行编译。 So, I disabled and re-enabled Maven in my project and that solved it.所以,我在我的项目中禁用并重新启用了 Maven 并解决了它。

I faced similar problem.我遇到了类似的问题。 This is what I did to resolve the issue.这就是我为解决这个问题所做的。

1.Select Project and right click. 1.选择项目并右键单击。 2.Click on properties. 2.点击属性。 3.Click on libraries tab. 3.单击库选项卡。 4.Click on 'Add Jars'. 4.单击“添加罐子”。 5.Add relavent jar for your error. 5.为您的错误添加相关的jar。

hope this helps.希望这会有所帮助。 Thanks.谢谢。

I had this problem because I copied the libraries manually and directly into the folder WEB-INF/lib of the project and eclipse doesn't see them (I suggest you copy any necessary libraries into WEB-INF/lib only through eclipse!).我遇到了这个问题,因为我手动将库直接复制到项目的文件夹WEB-INF/lib中,而 eclipse 看不到它们(我建议您仅通过 eclipse 将任何必要的库复制到WEB-INF/lib !)。 So only a refresh of the project solved the problem for me because all the other solutions didn't work!!所以只有刷新项目才能解决我的问题,因为所有其他解决方案都不起作用!!

(I'm using Eclipse Kepler unber Ubuntu) (我正在使用 Eclipse Kepler unber Ubuntu)

This is probably Eclipse getting a bit 'confused' rather than a genuine error.这可能是 Eclipse 变得有点“困惑”而不是真正的错误。

I had the same thing yesterday when working through a Struts 2 tutorial, but it disappeared after opening/closing the JSPs.昨天我在学习 Struts 2 教程时遇到了同样的事情,但在打开/关闭 JSP 后它消失了。

add struts2-core-.jar to the project将 struts2-core-.jar 添加到项目中

download it here在这里下载

http://struts.apache.org/development/2.x/index.html http://struts.apache.org/development/2.x/index.html

正如威廉所说,这听起来像是您的 IDE 可能不知道标签库的 TLD 在您的项目中的位置,但是一旦打包并运行,它就可以正常工作。

go to Project tab > Clean.. Even if cleaning the project doesn't clear the error, right-click on the project and click refresh转到项目选项卡> 清理.. 即使清理项目没有清除错误,右键单击项目并单击刷新

Then right-click on the project, go to properties, Java Build Path >> 'Order and Export' tab >> make sure JRE library and Maven dependencies are checked.然后右键单击项目,转到属性,Java 构建路径 >> 'Order and Export' 选项卡 >> 确保检查了 JRE 库和 Maven 依赖项。

that would probably solve it as it did for me这可能会像对我一样解决它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 eclipse : 找不到“/struts-tags”的标签库描述符 - eclipse : Can not find the tag library descriptor for “/struts-tags” 在jsp中找不到“/struts2-jquery-tags”的标签库描述符 - Can not find the tag library descriptor for “/struts2-jquery-tags” in jsp 骨瘦如柴的战争,EAR中的库:“未找到struts-tags”错误 - Skinny WAR, libraries in EAR: “struts-tags not found” error 在 Struts 1.3 中找不到文件“/struts-tags” - File “/struts-tags” not found in Struts 1.3 找不到springframework的标签库描述符 - Can not find the tag library descriptor of springframework 找不到标记库描述符 - Can't find tag library descriptor Eclipse“找不到自定义标签的标签库描述符”(不是JSTL!) - Eclipse “cannot find the tag library descriptor” for custom tags (not JSTL!) JSP错误“找不到“ http://java.sun.com/jsp/jstl/core”的标记库描述符 - JSP error “Can not find the tag library descriptor for ”http://java.sun.com/jsp/jstl/core" ClassNotFound:ComboPooledDataSource,后跟JasperException:/ struts-tags丢失 - ClassNotFound: ComboPooledDataSource, followed by JasperException: /struts-tags is missing 添加“ spring-security-taglibs”后,在jsp中仍然出现错误:找不到spring安全标签的标签库描述符 - After adding “spring-security-taglibs” Still getting error in jsp: Can not find the tag library descriptor for spring security tag
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM