是因为Eclipse的Web项目不自动引入相关jar包.
Right Click on the Project ? Properties ? Project Facets. You would be presented with the screen that would look similar to the following screen. On the right hand side, you would see two tabs: Details and Runtimes. Click Runtimes tab ? Check the Apache tomcat server ? Apply ? Ok
That’s it. This would solve the error.
Caution:tomcat/jdk的版本兼容问题.
原文:https://www.cnblogs.com/zienzir/p/9291024.html