"helloWorld" Dynamic Web Project 생성

CODEDRAGON Development/JSP

반응형

   

   

"helloWorld" Dynamic Web Project 생성

   

메뉴: [File] >> [New] >> [Dynamic Web Project]

   

Project name 입력 후 >> [Next]

   

[Next]

   

"Context root"는 각 프로젝트를 구분해주는 이름이며 기본적으로 생성시 설정한 프로젝트 명으로 설정되어 있습니다.

"Generate web.xml deployment descriptor"항목 체크 >> [Finish]

   

프로젝트 생성 완료

   

   

   

JSP파일 생성

"WebContent"폴던 선택 >> 마우스 우클릭 >> [New] >> [JSP File]

   

파일명 입력 후 >> [Finish]

   

JSP파일 생성 완료

   

기본 생성된 JSP파일 내용

<%@ page language="java" contentType="text/html; charset=EUC-KR"

pageEncoding="EUC-KR"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">

<title>Insert title here</title>

</head>

<body>

   

</body>

</html>

   

테스트위해 <body>태그 안에 "Hello World"라는 문구 추가

<%@ page language="java" contentType="text/html; charset=EUC-KR"

pageEncoding="EUC-KR"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">

<title>JSP Page</title>

</head>

<body>

<h1>Hello World!!!</h1>

</body>

</html>

   

해당 JSP파일 선택 후 마우스 우클릭 >>[ Run As] >> [Run on Server]

   

[Finish]

   

완료!!!

반응형