728x90
300x250
[JSP] 6. Apache Tomcat 9 기반으로 한 Eclipse에서 Servlet 사용하기(Using servlets in Eclipse based on Apache Tomcat 9)

 

Apache Tomcat 9와 Eclipse Java 2019-09를 활용한 Dynamic Web Project를 하나 진행하도록 하겠다.

해당 예제는 톰캣에 탑재되어 있는 기본 예제로 진행하였다.

(The Apache Tomcat 9 and the Eclipse Java 2019-09 A Dynamic Web Project will utilize the proceeds to one.

This example is a basic example of Tomcat.)

 


1. 실습 환경(Environmental Practice)

 

1. MS윈도우 10 1909(MS Windows 10 1909)

2. Apache Tomcat 9

3. Eclipse Java 2019-09

4. OpenJDK 13

 


2. 프로젝트 생성하기(Create a project)

 

프로젝트를 아래의 그림처럼 생성한다.(Create a project as shown below.)

 

 

 


3. Servlet 생성하기

 

서블랫에 대해서는 다음에 소개하도록 하겠다.

(I'll introduce you to the Servlet later.)

 

 

Java Resources 탭에서 src 폴더를 오른쪽 버튼을 클릭한다.

(Right-click the src folder on the Java Resources tab.)

 

 

그리고 New-> Servlet을 클릭한다.

(Then click New-> Servlet.)

 

 

 

 

 

 

 

 


4. Apache Tomcat 9의 Servlet API 찾기(Finding the Servlet API for Apache Tomcat 9)

 

서블랫의 경로는 아래의 그림처럼 존재한다.

C:\{Apache 설치경로}\lib\servlet-api.jar

(The servlet's path exists as shown below.

C:\{Apache installation path}\lib\servlet-api.jar)

 

 

 


5. 이클립스에 적용하기(Apply to Eclipse)

 

이클립스에 적용하는 방법이다. {프로젝트명} 폴더를 클릭 후 오른쪽 버튼을 클릭한다.

그리고 "Properties"를 클릭한다.

(This is how you apply it to Eclipse.

Right click on the {Project Name} folder.Then click "Properties".)

 

 

 

 

 


6. 소스코드 구현하기(Implement the source code)

 

소스코드를 작성해주면 된다.(Write the source code.)

 

 


7. 디버그 및 태스트하기

 

Eclipse Java 2019-09부터는 Server에 Apache Tomcat이 사라졌다.

(Starting with Eclipse Java 2019-09, Apache Tomcat disappeared from Server.)

 

 


7-1. WAS에 WAR 배포하기

 

WAS(이하 "Web Application Server")에 방금 작성한 자바 프로젝트를 배포하는 방법이다.

(How to deploy a Java project you just created to WAS ("Web Application Server").)

 

 

File->Export를 클릭한다.(Click File-> Export.)

 

 

 

 

배포 위치는 c:\apache-tomcat-***\webapps에 넣어주면 된다.

(The distribution location is in "c:\apache-tomcat-***\webapps.")

 

 


8. 웹 사이트 접속해보기(Go to the website)

 

웹 사이트에 접속하면 확인해볼 수 있다.(You can check it by visiting the website.)

 

반응형

+ Recent posts