Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have a project created by Maven integration in Eclipse. All work fine, but in the work space in all JSP files have this:

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

To the first string where place:

<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%> 

When I create a basic dynamic web project and JSP in - all is fine, no errors.

like image 339
disable1992 Avatar asked Mar 31 '14 07:03

disable1992


People also ask

How to fix the HttpServlet not found error in Eclipse?

Add the server runtime libraries In the window that appears, choose Java Build path on the left. Then choose the Libraries tab in the view that appears. Click the Add Runtime option and then select Server Runtime. Add the server runtime to the web project to fix the HttpServlet not found Eclipse error.

What is javax servlet HttpServlet?

An abstract class that simplifies writing HTTP servlets. It extends the GenericServlet base class and provides an framework for handling the HTTP protocol. Because it is an abstract class, servlet writers must subclass it and override at least one method.


1 Answers

Add a runtime first and select project properties. Then check the server name from the 'Runtimes' tab as shown in the image.

Select runtime from Project Facets as shown the in image

like image 150
Ajil Mohan Avatar answered Sep 22 '22 14:09

Ajil Mohan