java 无法为标签“s:form”加载标签处理程序类“org.apache.struts2.views.jsp.ui.FormTag”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2126053/
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-10-29 19:34:57  来源:igfitidea点击:

Unable to load tag handler class "org.apache.struts2.views.jsp.ui.FormTag" for tag "s:form"

javastruts2

提问by i2ijeya

If I run my code in NetbeansIDE it shows the following error:

如果我在 NetbeansIDE 中运行我的代码,它会显示以下错误:

org.apache.jasper.JasperException: /InvestorConfirm.jsp(53,12) PWC6032: Unable to load tag handler class "org.apache.struts2.views.jsp.ui.FormTag" for tag "s:form"

org.apache.jasper.JasperException:/InvestorConfirm.jsp(53,12) PWC6032:无法为标签“s:form”加载标签处理程序类“org.apache.struts2.views.jsp.ui.FormTag”

I downloaded the struts2-core-2.0.11.jar file, and searched for "struts2.views.jsp.ui.FormTag", but couldn't find that class.

我下载了struts2-core-2.0.11.jar文件,搜索“struts2.views.jsp.ui.FormTag”,却找不到那个类。

How can I resolve this issue?

我该如何解决这个问题?

回答by BalusC

To install Struts2, just put the Struts2 JAR file (and its dependencies) in the /WEB-INF/lib.

要安装 Struts2,只需将 Struts2 JAR 文件(及其依赖项)放在/WEB-INF/lib.

Do notextract the JAR file and spread all its loose contents (TLD files?) over the classpath as some pooronline tutorials (with roseindia.net as topper) may suggest. This exception namely indicates that the TLD file is been found in the classpath, but that the associated tag class is missing in the classpath. This can only happen if you did so. Cleanup the classpath and redo according Apache's own Struts2 docs.

难道不是在类路径的一些提取JAR文件和传播其所有松散的内容(TLD文件?)在线教程(含roseindia.net为礼帽)可能建议。此异常即表示在类路径中找到了 TLD 文件,但在类路径中缺少关联的标记类。这只有在您这样做时才会发生。根据 Apache 自己的 Struts2 文档清理类路径并重做。

This can by the way in theory also be caused by having different Struts2 versions in the classpath, but this is unlikely as the package of FormTaghas not been changed among versions.

理论上,这也可能是由于类路径中的 Struts2 版本不同造成的,但这不太可能,因为FormTag版本之间的包没有改变。