New MAVEN Web project in Eclipse Error: the superclass "Javax.servlet.http.HttpServlet" is not found on the Java Build Path

Source: Internet
Author: User
Tags apache tomcat

The error message in index.jsp in the MAVEN Web project is as follows:

The superclass "Javax.servlet.http.HttpServlet" is not found on the Java Build Path

As you can see from the error message, the class cannot be found, that is, the corresponding jar package cannot be found.

So the solution is to refer to the corresponding JAR package.

Premise:

You need to set up server Runtime,

Windows, Perferences, Server, Runtime environments, ADD, Apache Tomcat ... so you can do it step by step.

Workaround for this problem:

Project right-build path---Configure build path---Libraries---add Library---Server Runtime---select through the above steps above Server, and then click Apply.

You can see the errors on the JSP page disappear.

But you will also find that there is a small red fork on the project, which resolves as follows:

First view markers information (window–>show veiw–>markers)

The error message is:

Project configuration is not a up-to-date with pom.xml. Select:maven->update Project ... from the project context menu or by use Quick Fix.

Follow the steps to solve the problem! (Project right-click Maven, Update Project)

New MAVEN Web project in Eclipse Error: the superclass "Javax.servlet.http.HttpServlet" is not found on the Java Build Path

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.