jsp页面错误如下提示:

问题一:

jsp页面报错: The superclass "javax.servlet.http.HttpServlet" was not found on the Java;

缺少运行环境,配置java Build Path——>Libraries——> Add Library

jsp页面报错: The superclass "javax.servlet.http.HttpServlet" was not found on the Java;

选择MyEclipse Server Library

jsp页面报错: The superclass "javax.servlet.http.HttpServlet" was not found on the Java;

选择内置的Tomcat,也可以加入外部Tomcat,依次选择Finish/Applay确认选择

jsp页面报错: The superclass "javax.servlet.http.HttpServlet" was not found on the Java;

 

 

问题二:

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+"/";
%>

jsp页面报错: The superclass "javax.servlet.http.HttpServlet" was not found on the Java;

选择JRE System Library 

jsp页面报错: The superclass "javax.servlet.http.HttpServlet" was not found on the Java;

选择所需的版本,依次选择apply确认选项

jsp页面报错: The superclass "javax.servlet.http.HttpServlet" was not found on the Java;

 

添加完如图所示,选择apply and close完成配置

jsp页面报错: The superclass "javax.servlet.http.HttpServlet" was not found on the Java;

jsp页面报错: The superclass "javax.servlet.http.HttpServlet" was not found on the Java;

相关文章:

  • 2022-12-23
  • 2021-11-08
  • 2021-10-08
  • 2021-10-06
  • 2021-04-28
  • 2021-08-18
  • 2021-05-08
  • 2021-04-26
猜你喜欢
  • 2021-09-24
  • 2021-08-02
  • 2021-11-22
  • 2021-07-30
  • 2021-08-21
相关资源
相似解决方案