본문 바로가기

자바 웹을 다루는 기술

the import javax.servlet resolved 에러 해결방법

atoz-develop.tistory.com/entry/The-import-javaxservlet-cannot-be-resolved-%EC%97%90%EB%9F%AC-%ED%95%B4%EA%B2%B0-%EB%B0%A9%EB%B2%95

 

The import javax.servlet cannot be resolved 에러 해결 방법

깃허브에서 간단한 서블릿 프로젝트를 임포트했는데 빌드하고 나니 이런 에러들이 찍힌다. The import javax.servlet cannot be resolved를 포함해서 GenericServlet cannot be resolved to a type ServletExcept..

atoz-develop.tistory.com


그런데 갑자기 override error가 생겼다.

java compiler 버젼은 1.6으로 바꾸면 된다는데 나는 해결이 안된다.

 

The method init() of type FirstServlet must override or implement a supertype method

라고 뜨고

Multiple markers at this line
- The method printIn(String) is undefined for the type 
 PrintStream
- Line breakpoint:FirstServlet [line: 14] - init()

 

The method doGet(HttpServletRequest, HttpServletResponse) of type FirstServlet must override or implement a 
 supertype method

 

The method printIn(String) is undefined for the type PrintStream

차례대로 이런 에러가 뜬다

 


나는 바보였다. 

위에

The method init() of type FirstServlet must override or implement a supertype method라는 error는

FirstServlet 유형의 메서드 초기화()는 슈퍼타입 메서드를 재정의하거나 구현해야 한다. 라는 뜻인데

이제막 super랑 this 공부하던 참이라 빨리 찾을 수 있었다.

위의 코드를 빼먹어서 생긴 에러였다.

하지만 아래 에러는 그대로다.

 


이 선에 여러 마커 표시 - 메서드 printIn(String)이 유형에 대해 정의되지 않음 프린트스트림 - 선 중단점:FirstServlet [line: 14] - init()

두 가지 에러 중 첫번째는 저렇게 .만찍고 메서드를 호출했더니 사라졌다.

두번째 에러는 일단 큰문제가 아닌거 같아서 넘어가겠다.

'자바 웹을 다루는 기술' 카테고리의 다른 글

input tag에 hidden속성  (0) 2020.09.16
USD_RATE cannot be resolved to a variable  (0) 2020.09.16
response cannot be resolved  (0) 2020.09.16
6.4 서블릿 응답 처리 방법MIME-TYPE  (0) 2020.09.16
오라클 접속 에러  (0) 2020.09.14