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完成配置