这是用eclipse创建web project后,刚打开index.jsp网页时出现的错误。
出错截图:
这是因为编写的此项目没有导入tomcat的jar包所致。
以下给出解决方法:
- 右击项目名,找出build path-->configure build path...-->libraries-->classpath-->add library...-->server runtime-->apache tomcat v9.0选中【注意,中间选中的是server runtime,而不是JRE System Library】
- 换到Order and Export界面,选中Apache tomcat v9.0然后一路返回就可以了。
window--preferences--server--runtime environments--add--选中需要的版本,然后在tomcat installation directory下选中本版本安装的目录,一步步返回,之后再去重复上述1,2步即可。