DynamicWebProject报错The superclass"javax.servlet.http.HttpServlet"was not found on the Java BuildPath
在MyEclipse创建Dynamic Web Project项目,在项目中jsp页面报错:
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
如图:
解决方案:
①eclipse是否配置了tomcat服务器
如果没有则需要配置tomcat:
点击下载tomcat:点击打开链接
解压到D盘:
window-preferences
MyEclipse-Servers-Tomcat
Enable-Tomcat home directory
②配置完tomcat,向报错的动态网页项目添加Tomcat Runtime Libraries
右击报错的项目名-Build Path-Configure Build Path...
Java Build Path-Libraries-Add Library...
MyEclipse Server Library-Next(需要注意的是,这里不同于Eclipse,Eclipse在这里的选项是:Server Runtime,而MyEclipse在这里的选项则是:MyEclipse Server Library,没有Server Runtime选项)
选择自己下载的Tomcat,我这里是Tomcat Version7.0,然后点击finish,
退到前一个配置页面还要点击OK这个时候配置完成
动态网页项目报错消失,错误顺利解决。