zoukankan      html  css  js  c++  java
  • The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

    问题描述

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

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html dir="ltr" lang="zh-CN">
    <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    
    <title>MavenDemo</title>
    <meta name="keywords" content="Maven,Java Web" />
    <meta name="description" content="">
    </head>
    <body>
    	<h2>Hello World!</h2>
    </body>
    </html>
    

    解决方法

    1)右键项目 —> Build Path —> Configure Build Path... —> Java Build Path —> Libraries —> Add Libraries... —> JRE System Library —> Next —> 选择 Workspace default JRE(JDK Version) —> Finish。

    2)继续 Add Libraries... —> Server Runtime —> Next —> 选择 Apache Tomcat v7.0(Apache Tomcat Version) —> Finish —> OK。

    3)右键项目 —> Maven —> Update Project... —> 勾选项目 mavenDemo —> OK 即可。

  • 相关阅读:
    手机通讯录实现
    leetcode
    android 上手维修设备和推断启动服务
    MVC Code First (代码优先)
    10000阶乘
    telnet发电子邮件
    nodejs显现events.js:72抛出错误
    指针
    脑洞门大开思维工具:六顶思考帽
    C#实现CAD数据转shape或mdb
  • 原文地址:https://www.cnblogs.com/wumz/p/10715892.html
Copyright © 2011-2022 走看看