jsp页面错误如下提示:
问题一:

缺少运行环境,配置java Build Path——>Libraries——> Add Library
选择MyEclipse Server Library
选择内置的Tomcat,也可以加入外部Tomcat,依次选择Finish/Applay确认选择
问题二:
Multiple annotations found at this line:
- String cannot be resolved to a type
- The method getContextPath() from the type HttpServletRequest refers to the missing type
String
Multiple annotations found at this line:
- String cannot be resolved to a type
- The method getServerName() from the type ServletRequest refers to the missing type
String
- The method getScheme() from the type ServletRequest refers to the missing type
String
如图:
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
选择JRE System Library
选择所需的版本,依次选择apply确认选项
添加完如图所示,选择apply and close完成配置