Programming/JSP,Servlet 2

[JSP/Servlet] WebServlet cannot be resolved to a type 에러 해결 방법 (Tomcat & Eclipse)

WebServlet cannot be resolved to a type 에러 해결 방법 (Tomcat & Eclipse) WebServlet cannot be resolved to a type 에러는 프로젝트 파일을 import 하거나 설정 도중 톰캣의 Build Path가 누락되어 발생할 수 있는 에러 입니다. 아래와 같이 프로젝트의 Build Path에 톰캣을 추가하여 해결할 수 있습니다. 1. 프로젝트 우클릭 → 하단의 Properties 클릭 2. Java Build Path → Libraries → Add Library... 3. Server Runtime → Next → Apache Tomcat v8.5 (설치했던 톰캣 버전에 따라 다를 수 있습니다) → Finish 이후 Apply 하면 We..

[JSP/Servlet] JSP/Servlet 500 에러 "javax.servlet.ServletException: java.lang.NoClassDefFoundError" 해결 방법

JSP/Servlet 500 에러 "javax.servlet.ServletException: java.lang.NoClassDefFoundError" 해결 방법 JSP 사용 시 500 에러 "javax.servlet.ServletException: java.lang.NoClassDefFoundError"가 발생할때가 있는데, 이는 보통 세팅에서의 문제로 인해 발생하는 경우가 많습니다. 보통 웹 애플리케이션 디렉터리 구조를 가지고 있는 환경에서 Build Path가 WEB/bin에 설정되어 있어 class 파일을 찾을 수 없거나, Servlet에 필요한 jar 파일을 라이브러리에 적용시키지 않아 발생하는 에러 입니다. Build Path의 문제일 경우 자신의 디렉터리 구조에 맞게 변경해야 합니다. (ex...