在Eclipse IDE进行Struts开发时提示错误:java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher的解决办法
If you have...
- included all necessary jars
- Configured build path correctly
- added them all in deployment assembly
Correctly.
then also you getting "java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher" error then you could be doing below things wrong.
solution:
check your struts2-core-x.x.jar version.
-->if it is struts2-core-2.5.jar then change your filter class tag value in web.xml to
<filter-class>
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
</filter-class>
-->if it is struts2-core-2.1.3.jar then change your filter class tag value in web.xml to
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
FilterDispatcher is deprecated since Struts 2.1.3. If you are working with older versions then user above solution.
-->if it is struts2-core-2.3.X.jar then change your filter class tag value in web.xml to
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
Reason behind all this is struts 2 controllers are placed in different location in different version of struts2-core jar and some time they are called by different name as you can see in 2.1.3.
Thank you!
需要注意的是:
在struts2.1版本之前,所使用的核心过滤器类是 org.apache.struts2.dispatcher.FilterDispatcher,从struts2.1版本之后,已经不推荐使用,而是使用org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter类。但是当struts版本发展到2.5之后的版本时,推荐将类完全名称中的ng去掉,即使用org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter类。
在Eclipse IDE进行Struts开发时提示错误:java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher的解决办法的更多相关文章
- 第一次部署Struts2时出现错误java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.class
报如下错误 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) at org. ...
- java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter /struts2.1.3以前版本和之后版本区别/新版Eclipse找不到Java EE Module Dependencies选项
严重: Exception starting filter struts2java.lang.ClassNotFoundException: org.apache.struts2.dispatcher ...
- IDEA调试SpringMvc项目时,出错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener,解决办法
具体报错信息如下图所示: 解决方法:File > Project Structure > Artifacts > 在右侧Output Layout右击项目名,选择Put into O ...
- IE浏览器下载文件保存时提示:“你没有权限在此位置中保存文件”解决办法
E浏览器下载文件保存时提示 解决办法: 1.Win + R,打开运行命令,输入gpedit.msc,如图所示 2.打开计算机本地组策略编辑器:选择计算机配置-windows设置-安全设置-本地策略-安 ...
- mysql数据库导入sql文件时提示“Error Code: 1153 - Got a packet bigger than 'max_allowed_packet' bytes”解决办法
向mysql数据库中导入sql文件时,如果文件过大(几百M),会提示"Error Code: 1153 - Got a packet bigger than 'max_allowed_pac ...
- usb设备(移动硬盘或U盘),弹出时提示“有进程或程序占用,无法弹出”。解决办法
测试环境:Win7(其他Windows系统环境,也可参考) 总结办法来源,https://bbs.csdn.net/topics/392297251?page=1文章中热心网友的评论指引 1. 控制面 ...
- 已解决: idea创建并部署SpringMVC项目时 报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
用IDEA创建并运行SpringMVC项目时,最初发现没有Servlet包,这个问题已在上篇解决,然而当我们尝试去运行此时的SpringMVC项目时,发现仍然有错误.ClassNotFoundExce ...
- eclipse中部署web项目时报错java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener的解决方法
解决方案: 1.右键点击项目--选择Properties,选择Deployment Assembly,在右边点击Add按钮,在弹出的窗口中选择Java Build Path Entries 2.点击N ...
- Androidstudio预览时出现错误java.lang.NoClassDefFoundError: com/android/util/PropertiesMap
参考博客;http://blog.csdn.net/daqi1983/article/details/51474588 更改对应版本的SDK即可.
随机推荐
- Android笔记(四十一) Android中的数据存储——SQLite(三)select
SQLite 通过query实现查询,它通过一系列参数来定义查询条件. 各参数说明: query()方法参数 对应sql部分 描述 table from table_name 表名称 colums s ...
- Shodan information gathering use parameter
1.we sue the Search Engines Shodan we can gather much information on the line web , such we want to ...
- Python入门篇-基础数据类型之整型(int),字符串(str),字节(bytes),列表(list)和切片(slice)
Python入门篇-基础数据类型之整型(int),字符串(str),字节(bytes),列表(list)和切片(slice) 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Py ...
- 一种使用gitlab的CI/CD功能实现Nginx配置更新的方法
至于nginx的docker制作,前面已介绍过. 现在使用gitlab在线编辑的方式,可实现Nginx的自定义配置并更新. .gitlab-ci.yml内容如下: variables: project ...
- linux的vim基本使用
转自:https://www.cnblogs.com/qq631243523/p/10191714.html 所有的 Unix Like 系统都会内建 vi 文书编辑器,其他的文书编辑器则不一定会存在 ...
- 用数组实现strstr函数
用数组实现strstr函数char * mystrstr(char * dest, char *src){ int i = 0; int j = 0; //匹配个数 int count = 0; in ...
- 序列:SEQUENCE
一.序列介绍 Oracle的序列是一种数据库对象,主要作用是用来产生唯一值.序列被创建以后可以通过数据字典找到序列对象,因此序列可以被多个对象共享. 二.创建序列 序列使用CREATE SEQUENC ...
- Net线程间通信的异步机制
线程间通信 我们看下面的图 我们来看线程间通信的原理:线程(Thread B)和线程(Thread A)通信, 首先线程A 必须实现同步上下文对象(Synchronization Context), ...
- 浏览器缓存控制 以及 在url框中回车、F5 和 Ctrl + F5的区别
第一部分: 浏览器缓存如何控制? 做网站,不知道缓存是什么东西怎么能行! 如何实现HTTP缓存呢? 下面我们来一步一步的探寻实现机制把. 方案一: 无缓存 说明:浏览器向服务器请求资源m.pn ...
- ubuntu14.04 部署nfs服务
安装nfs服务 apt-get install nfs-kernel-server 修改配置文件,共享目录为/var/www,*号可替换为客户端IP地址,*默认为任何部署了nfs客户端的IP可以挂载该 ...