• 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 即可。

  • 相关阅读:
    nginx超时问题
    linux打包文件,压缩文件
    centos查看文件夹大小
    Nginx反向代理和负载均衡
    nginx的location配置详解
    nginx错误Upstream timed out
    mysql处理函数
    SQL左右连接中的on and和on where的区别
    html select change事件触发
    get,post区别
  • 原文地址:https://www.cnblogs.com/wumz/p/10715892.html
Copyright © 2020-2023  润新知