JSP/개발환경 설정

STS 와 Tomcat 연동시키는 방법

carrot62 2020. 8. 3. 22:41

STS와 Tomcat을 연동하여 jsp 파일을 서버에서 실행시켜보자.

참고) Tomcat 라이브러리를 반드시 추가해주어야 서버가 정상적으로 작동이 되고, jsp 파일을 구동할 수 있다.


1.  STS와 Tomcat 연동시키기

Window → preference → Server → Runtime Environments
Add 버튼 클릭 → Tomcat 등록하기

2.  STS의 Tomcat 서버에 만든 웹 프로젝트 (ex. Hello) 등록하기

Tomcat server 오른쪽 클릭 → Add and Remove → Start (초록색 재생 버튼 누르기)

정상적으로 작동된 화면:

참고 1: https://androphil.tistory.com/227?category=423962

참고 2: https://codewithself.tistory.com/62


참고:  연동하는 과정에서 일어날 수 있는 에러에 대한 해결방법:

오류1) "The server cannot be started because one or more of the ports are invalid. Open the server editor and correct the invalid ports."

Tomcat server 더블 클릭 후
Tomcat admin port의 Port Number를 수정해주도록 하자

참고: https://marshmello.tistory.com/40

오류 2) Starting Tomcat v8.5 Server at localhost' has encountered a problem. Port is already in use

HTTP의 port number를 8085로 변경

참고: https://coding-factory.tistory.com/13