SEVERE: Exception starting filter struts2 java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher(严重:异常启动过滤器 struts2 java.lang.ClassNotFoundException:org.apache.struts2.dispatcher.FilterDispatcher)
问题描述
我正在尝试在 struts 2 中制作一个小型登录应用程序.我的 web.xml:
I am trying to make a small login application in struts 2. My web.xml:
Struts.xml:
Struts.xml:
login.jsp:
Welcome.jsp:
Welcome.jsp:
LoginAction.java:
LoginAction.java:
我已将这些库添加到我的项目中:
And i have added these libraries to my project:
- commons-logging-1.0.4.jar
- struts2-core-2.1.8.1.jar
- ognl-2.6.11.jar
- xwork-2.1.0.jar
- freemarker-2.3.9.jar
当我尝试在 Tomcat 6 上运行它时,出现以下错误:
When I try to run this on Tomcat 6 I got following error:
推荐答案
确保您的类路径上有以下内容:
Make sure the following are on your class path:
- commons-fileupload-X.X.X.jar
- commons-io-X.X.X.jar
- commons-logging-X.X.X.jar
- commons-logging-api.X.X.jar
- freemarker-X.X.X.jar
- ognl-X.X.X.jar
- struts2-core-X.X.X.X.jar
- xwork-core-X.X.X.jar
- javassist-3.7.ga.jar(Struts 2.2.1 及更高版本的新功能)
- commons-lang3-x.x
您是否关注过 https://struts.apache.org/getting-started/how-to-create-a-struts2-web-application.html 来设置你的项目?
Have you followed https://struts.apache.org/getting-started/how-to-create-a-struts2-web-application.html to set up your project?
试试:
这篇关于严重:异常启动过滤器 struts2 java.lang.ClassNotFoundException:org.apache.struts2.dispatcher.FilterDispatcher的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!