Description Resource Path Location Type The superclass "javax.servlet.http.HttpServlet" was not foun

Description Resource Path Location Type

The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path index.jsp /SpringBootDemo/src/main/webapp line 1 JSP Problem

学SpringBoot建第一个项目遇到的小问题
问题如下:在这里插入图片描述主要问题:Description Resource Path Location Type
The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path index.jsp /SpringBootDemo/src/main/webapp line 1 JSP Problem
虽说项目可以运行但是有一丢丢的我来说很是难受呀。
解决方案(去掉错误):以下步骤
在自己的项目上点击右键–>鼠标划到最下面properties进行点击
在这里插入图片描述
点击点击Add Library进去
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
这样问题就解决了没有了红叉叉了可以正常运行了
Application.代码块

package com.chinasoft.SpringBoot_1;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.support.SpringBootServletInitializer;

/*把普通java类 转换成SpringBoot的框架启动类

  • 需要spring的虚拟注解 及继承web服务的父类*/
    @SpringBootApplication
    @ServletComponentScan
    public class Application extends SpringBootServletInitializer{

    /框架启动方法/
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    /用线程工具方法启动 保证单线程/
    SpringApplication.run(Application.class, args);
    }

}


  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值