본문 바로가기

개발관련/error

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

728x90

Problem

STS 4.15.3 RELEASE 사용 중 JSP 파일 추가하자 발생한 에러.

maven 프로젝트.

 

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

 

cause

java 빌드 경로에서 javax servlet 인 HttpServlet을 찾을 수 없음

 

 

resolving

 

pom.xml 기존에 embed만 추가했으나 javax.servlet 추가하기, 추가 후 jsp 파일 지우고 새로 생성하기

<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-jasper -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>4.0.1</version>
    <scope>provided</scope>
</dependency>