检查tomcat是否有效
右击项目,properties>>targetRuntimes
若标红,重新配置Tomcat
window>>preferences
右击项目,properties>>Java build path