1. ์ํฌ์คํ์ด์ค ์ฌ์ค์
SPRING ํด๋ ์์ฑ > sts ์์ ์ํฌ์คํ์ด์ค ์์น ๋ค์ ์ก์์ฃผ๊ธฐ
2. sts ์ค์
window > preferences >
1) general > web browser , workspace
2) Web > CSS/ HTML/ JSP Files
3. ํ๋ก์ ํธ ์ด๊ธฐ ์ค์
1) ๋ ๊ฑฐ์ ํ๋ก์ ํธ ์์ฑ
Finish! -> ์ด๊ธฐ์๋ ๋ญ๊ฐ ๋ค์ด๋ฐ์๊ฑฐ๋ ๋ฌป๋๋ฐ yes ๋๋ฌ์ฃผ๋ฉด ๋๋ค.
2) ๋ฐ ์๋ฒ ์ด๊ธฐ ์ค์
ํ๋ก์ ํธ ์ด๋ฆ์์ ์ฐํด๋ฆญ > Run As > Run On Server
next ๋๋ฌ์ ์คํ์ํฌ ํ๋ก์ ํธ๋ง ๋จ๊ธฐ๊ณ ๋ค๋ฅธ ํ๋ก์ ํธ๋ remove all ํด์ค๋ค.
์คํํ๋ฉด ๋ฐฉํ๋ฒฝ ํ์ฉ ์๋ฆผ์ฐฝ์ด ๋จ๋๋ฐ ํ์ฉํด์ฃผ๋ฉด ์นํ์ด์ง์์ ๋ฌ๋ค.
ํฐ์บฃ ์ค์ ์ jsp์ ๋ง์ฐฌ๊ฐ์ง๋ก ํ ๋ฒ๋ง ํด์ฃผ๋ฉด ๋๋ค.
3) JSP ํ์ผ ์ค์
new > other > jsp file
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link rel="stylesheet" href="resources/css/common.css" type="text/css">
<style></style>
</head>
<body>
<table>
<thead>
<tr>
<th>๋ฒํธ</th>
<th>์ ๋ชฉ</th>
<th>๊ธ์ด์ด</th>
<th>์กฐํ์</th>
<th>์ญ์ </th>
</tr>
</thead>
<tbody>
<c:forEach items="${list}" var="dto">
<tr>
<td>${dto.idx}</td>
<td><a href="detail.do?idx=${dto.idx}">${dto.subject}</a></td>
<td>${dto.user_name}</td>
<td>${dto.bHit}</td>
<td><a href="del.do?idx=${dto.idx}">์ญ์ </a></td>
</tr>
</c:forEach>
</tbody>
</table>
</body>
<script></script>
</html>
OK๋ฅผ ๋๋ฅธ ํ html5 ์ ํ > finish
์์ผ๋ก spring์์ ํ๋ก์ ํธ๋ฅผ ๋ง๋ค ๋๋ 3-1) ์ฒ๋ผ Spring Legacy Project๋ฅผ ์ ํํ์ฌ ๋ง๋ ๋ค.
'Back-End > SPRING' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
build ] spring ํ๋ก์ ํธ tomcat์ผ๋ก buildํ๊ธฐ (0) | 2022.07.18 |
---|---|
SPRING] ์ธ๋ถ ํ๋ก์ ํธ ํ์ผ์ด ์ ๋๋ก import ๋์ง ์์ ๋ (0) | 2022.05.23 |
SPRING] ์คํ๋ง ํ๋ก์ ํธ ์์ฑ, ์ค์ ํ๊ธฐ (0) | 2022.05.23 |