MapleStory Finger Point

๐ŸŸค JAVA/๐ŸŸค Spring

[Spring / ์‹ค์Šต1] ์ ์ˆ˜ ๋“ฑ๋ก ํŽ˜์ด์ง€ ๋งŒ๋“ค๊ธฐ (UI, ํ™”๋ฉด์ œ์ž‘)

HYEJU01 2024. 8. 25. 18:27

 

1) ์ ์ˆ˜ ๋“ฑ๋ก ํŽ˜์ด์ง€์—์„œ ์ ์ˆ˜๋ฅผ ๋“ฑ๋กํ•˜๋ฉด
2) ๋“ฑ๋ก์ด ๋˜์—ˆ๋‹ค๋Š” ๊ฒฐ๊ณผ ํ™”๋ฉด์ด ๋œฌ๋‹ค. 
3) ์ดํ›„ ๋ฆฌ์ŠคํŠธ ํ™”๋ฉด์œผ๋กœ ์ด๋™ํ•˜๋ฉด ๋“ฑ๋กํ•œ ์ ์ˆ˜๋ฅผ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

 

 

1)  UI ์ œ์ž‘ ( jsp ํ™”๋ฉด ๊ตฌ์„ฑํ•˜๊ธฐ ) 

scoreRegist.jsp
scoreResult.jsp
scoreList.jsp

 

 

[code] scoreRegist.jsp

๋”๋ณด๊ธฐ
<%@ 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>

<style>

	* {
	 list-style-type: none; margin: 0; padding: 0;
	}
	
</style>

</head>
<body>

	<form action="scoreForm" method="post">
	
	<ul>
		<li> ์ด๋ฆ„:<input type="text" name="name"></li>
		<li> ๊ตญ์–ด:<input type="number" name="kor"></li>
		<li> ์ˆ˜ํ•™:<input type="number" name="math"></li>
		<li> ์˜์–ด:<input type="number" name="eng"></li>
	</ul>
		
		<input type="submit" value="์ ์ˆ˜๋“ฑ๋ก">
	</form>


</body>
</html>

 

 

[code] scoreResult.jsp

๋”๋ณด๊ธฐ
<%@ 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>
	
	<h3>์ ์ˆ˜ ๋“ฑ๋ก์ด ์ •์ƒ์ฒ˜๋ฆฌ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!</h3>
	
	<a href="scoreList">๋ชฉ๋กํŽ˜์ด์ง€</a>
	<a href="scoreRegist">์ ์ˆ˜๋“ฑ๋ก</a>
	
	
</body>
</html>

 

 

[code] scoreList.jsp

๋”๋ณด๊ธฐ
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
	
	table, tr, td {
		border: 1px solid #ddd;
	}


</style>
</head>
<body>
	
	<table>
	<c:forEach var="vo" items="${list }" varStatus="a" >
	<tr>
		<td> ${a.index } </td>
		<td> ${vo.name }</td>
		<td> ${vo.kor }</td>
		<td> ${vo.eng }</td>
		<td> ${vo.math }</td>
		<td> <button type="button" onclick="location.href='deleteScore?sno=${vo.sno}';">์‚ญ์ œ</button> </td>
	</tr>
	</c:forEach>
	</table>
	<a href="scoreRegist">์ถ”๊ฐ€๋“ฑ๋กํ•˜๊ธฐ</a>

</body>
</html>