升级到tomcat8遇到The method getDispatcherType() is undefined for the type HttpServletRequest

今天升级到tomcat8,发现原来的项目不能运行了,遇到下面的错误:The method getDispatcherType() is undefined for the type HttpServletRequest。 
意思就是在HttpServletRequest没有定义getDispatcherType方法,上网找找了资料说是因为tomcat8里已经有了,老项目里的和他重复了,打开lib目录,找到servlet-api-XXX.jar将其改名如下图。

然后重新启动项目OK了。

另外一般ecliplse是没有tomcat8的,最高到tomcat7,这是需要安装一个ecllipse的插件。进到help的“install new software”,输入插件地址:http://download.eclipse.org/webtools/repository/luna

pending结束后打开“Web Tools Platform(WTP) 3.6.3”,找到下图所示的两个插件,安装上就有了

原文地址:https://www.cnblogs.com/liughost/p/4350172.html