无法加载标签处理程序类“org.apache.struts2.views.jsp.ui.FormTag”对于标签“s:form”
如果我在 NetbeansIDE 中运行代码,它会显示以下错误:
org.apache.jasper.JasperException: /InvestorConfirm.jsp(53,12) PWC6032: 无法加载标签处理程序类 “org.apache.struts2.views.jsp.ui.FormTag” 对于标签“s:form”
我下载了struts2-core-2.0.11.jar文件,并搜索“struts2.views.jsp.ui.FormTag”,但找不到该类。
我该如何解决这个问题?
If I run my code in NetbeansIDE it shows the following error:
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"
I downloaded the struts2-core-2.0.11.jar file, and searched for "struts2.views.jsp.ui.FormTag", but couldn't find that class.
How can I resolve this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要安装 Struts2,只需将 Struts2 JAR 文件(及其依赖项)放入
/WEB-INF/lib
中。不要提取 JAR 文件并将其所有松散内容(TLD 文件?)散布在类路径上,正如一些糟糕在线教程(以 Roseindia.net 作为顶部)可能建议的那样。此异常即表示在类路径中找到了 TLD 文件,但在类路径中缺少关联的标记类。只有您这样做才会发生这种情况。根据 Apache 自己的 Struts2 文档清理类路径并重做。
顺便说一下,理论上这也可能是由于类路径中的 Struts2 版本不同造成的,但这不太可能,因为
FormTag
的包在版本之间没有更改。To install Struts2, just put the Struts2 JAR file (and its dependencies) in the
/WEB-INF/lib
.Do not extract the JAR file and spread all its loose contents (TLD files?) over the classpath as some poor online 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.
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
FormTag
has not been changed among versions.