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

前端 未结 17 1793
醉话见心
醉话见心 2020-12-24 02:32

I\'m a beginner and learning spring and hibernate (utilizing maven in project)and came across this problem and got stuck here. tried finding solution but ended up no where.

相关标签:
17条回答
  • 2020-12-24 03:20

    I came across the same issue. I tried adding the server in "Server Runtime" but unfortunately that didn't work for me.

    What worked for me is, I added javax.servlet-api-3.0.1.jar file in build path. On the other hand If It's a Maven project add dependency for this jar file. This would definitely work.

    0 讨论(0)
  • 2020-12-24 03:20

    Always check if your java files are in src/main/java and not on some other directory path.

    0 讨论(0)
  • 2020-12-24 03:20

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

    Error: "Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"

    Solution: Adding the tomcat server in the server runtime will do the job : Project Properties-> Java Build Path-> Add Library -> Select "Server Runtime" from the list-> Next->Select "Apache Tomcat"-> Finish

    This solution work for me.

    0 讨论(0)
  • 2020-12-24 03:22

    Adding the tomcat server in the server runtime will do the job :

    Project Properties-> Java Build Path-> Add Library -> Select "Server Runtime" from the list-> Next->Select "Apache Tomcat"-> Finish
    
    0 讨论(0)
  • 2020-12-24 03:26

    you are getting this error because of the server is not enabled by default i.e you don't have any runtime chosen for that is why you are getting the error so, for that you need to do the following steps to choose the runtime.

    Follow The Path right-click on the project --> GoTo Properties--> Click on Targeted Runtimes-->then click on the checkbox i.e Apache tomcat or other servers which you are using --->then click on apply and then apply and close

    0 讨论(0)
  • 2020-12-24 03:28

    Adding below dependency in pom.xml, worked for me.

    <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题