Search

JSP ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

JSP ํ”„๋กœ์ ํŠธ ์ƒ์„ฑํ•˜๊ธฐ

1.
[File] > [New] > [Dynamic Web Project]
a.
Project Name : Test
b.
Target runtime : Apache Tomcat v9.0
c.
Dynamic web module version : 3.1
2.
WebContent
a.
[์šฐํด๋ฆญ] > [New] > [JSP]
b.
File name : index.jsp

ํ”„๋กœ์ ํŠธ์—์„œ Server ์„ ํƒํ•˜๊ธฐ

1.
ํ”„๋กœ์ ํŠธ ์šฐํด๋ฆญ
2.
Properties
3.
Server
4.
Tomcat Server ์„ ํƒ
5.
[Apply]

JSP ํ”„๋กœ์ ํŠธ ์‹คํ–‰ํ•˜๊ธฐ

1.
ํ”„๋กœ์ ํŠธ ์šฐํด๋ฆญ
2.
[Run As] > [Run On Server]

๋ฉ”์ธ ํ™”๋ฉด (index.jsp) ๋งŒ๋“ค๊ธฐ

1.
New
2.
JSP File
3.
์ฝ”๋“œ ์ž‘์„ฑ
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> <h1>๋ฉ”์ธ ํŽ˜์ด์ง€</h1> </body> </html>
HTML
๋ณต์‚ฌ

์„œ๋ฒ„ ์‹คํ–‰

1.
ํ”„๋กœ์ ํŠธ ์šฐํด๋ฆญ
2.
RUN As
3.
Run opn Server

์ดํด๋ฆฝ์Šค ํ†ฐ์บฃ ์„œ๋ฒ„ ์‹คํ–‰ ์‹œ, ํฌํŠธ ์—๋Ÿฌ

The server cannot be started because one or more of the ports are invalid. Open the server editor and correct the invalid ports.
์„œ๋ฒ„๋Š” ํ•˜๋‚˜ ์ด์ƒ์˜ ์œ ํšจํ•˜์ง€ ์•Š์€ ํฌํŠธ๋กœ ์ธํ•ด ์‹œ์ž‘ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์„œ๋ฒ„ ํŽธ์ง‘๊ธฐ๋ฅผ ์—ด๊ณ  ์œ ํšจํ•˜์ง€ ์•Š์€ ํฌํŠธ๋ฅผ ์ˆ˜์ •ํ•˜์‹ญ์‹œ์˜ค.

๊ฒฐ๊ณผ ํ™”๋ฉด

ํ”„๋กœ์ ํŠธ๋ฅผ ์„œ๋ฒ„์— ๋“ฑ๋ก ๋ฐ ์ œ๊ฑฐ

1.
[Windows] > [Show View] > [Other] > [Server]
2.
Server ์šฐํด๋ฆญ
3.
[Add and Remove]
4.
[Add] OR [Remove]

Eclipse ์›น๋ธŒ๋ผ์šฐ์ € ์„ค์ •ํ•˜๊ธฐ

1.
[Windows] > [Web Browser]
2.
Defulat System Browser ๋˜๋Š” Chrome