The superclass"javax.servlet.http.HttpServlet" was not found on the Java Build Path

问题描述

       学习ssh商城的时候,将资料中给的静态文件引入jsp文件夹,但是每个文件都有一个大红×,,然后在jsp文件里面出现了The superclass"javax.servlet.http.HttpServlet" was not found on the Java Build Path错误异常

原因分析

       在Javaweb工程下没有引入中间件(服务器Tomcat)运行的library

解决办法

(1)确认eclipse中server的运行环境是否有配置,设置方法为:Window-->Preferences-->Server-->RuntimeEnvironments-->Add-->选择Apache的版本后点Next,再填入安装的Apache Tomcat软件的安装目录       

(2)右击web工程-->Build Path-->Configure buildpath-->Java Build Path -->Libraries-->Add Library-->ServerRuntime-->Next-->Apache Tomcat Server--Finish

原文地址:https://www.cnblogs.com/curedfisher/p/13540117.html