๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ปWEB BackEnd/JSP

(8)
๊ตฌํ˜„(1) - ํšŒ์›๊ฐ€์ž… ๋ฐ ์ด๋ฉ”์ผ ์ธ์ฆ ์ด๋Ÿฌํ•œ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด์„  2๊ฐ€์ง€ util class๊ฐ€ ํ•„์š”ํ•˜๋‹ค. SHA256.java : ์ด๋ฉ”์ผ ์ธ์ฆ์„ ์œ„ํ•ด ์‚ฌ์šฉ๋˜๋Š” ํด๋ž˜์Šค Gmail.java : Gmail SMTP๋ฅผ ์ด์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ ์ •๋ณด๋ฅผ ๋„ฃ๋Š” ํด๋ž˜์Šค util ํด๋ž˜์Šค ์„ค์ • 1) SHA256.java : ์ด๋ฉ”์ผ์— ํ•ด์‰ฌ๋ฅผ ์ ์šฉํ•œ ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•˜๋Š” ํด๋ž˜์Šค package util; import java.security.MessageDigest; public class SHA256 { public static String getSHA256(String input) { StringBuffer result = new StringBuffer(); try { MessageDigest digest = MessageDigest.getInstance("SHA-256")..
ํšŒ์› ๋ฐ์ดํ„ฐ ๋ชจ๋ธ๋ง ๋ฐ์ดํ„ฐ ๋ชจ๋ธ๋ง ์„ค๊ณ„๊ฐ€ ๋œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ํ…Œ์ด๋ธ”์„ ํ† ๋Œ€๋กœ JAVA ์†Œ์Šค์ฝ”๋“œ๋กœ ์ž‘์„ฑํ•ด์ฃผ๋ฉด๋œ๋‹ค. UserDTO ํด๋ž˜์Šค ์„ค์ • 1) ํŒŒ์ผ ์ƒ์„ฑ Java Resources ํด๋” > src > user ํŒจํ‚ค์ง€๋ฅผ ์ƒ์„ฑํ•˜๊ณ , user ํŒจํ‚ค์ง€ > UserDTO.java ํด๋ž˜์Šค, UserDAO ํด๋ž˜์Šค๋ฅผ ์ƒ์„ฑํ•ด์ค€๋‹ค. ์ƒ์„ฑํ•œ UserDTO.java ํŒŒ์ผ ์•ˆ์— ๋‹ค์Œ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•ด์ค€๋‹ค. package user; public class UserDTO { private String userID; private String userPassword; private String userEmail; private String userEmailHash; private Boolean userEmailChecked; } 2) ๋ณ€์ˆ˜์˜ getter, ..
DB ์„ค๊ณ„ & ๋ฐ์ดํ„ฐ ๋ชจ๋ธ๋ง DB ์„ค๊ณ„ LE ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค > User ํ…Œ์ด๋ธ” CREATE DATABASE LE; USE LE; CREATE TABLE LE ( userID varchar(20) PRIMARY KEY, userPassword varchar(64), userEmail varchar(50), userEmailHash varchar(64), userEmailChecked boolean, ); DESC USER; LE ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค > EVALUATION ํ…Œ์ด๋ธ” CREATE TABLE EVALUATION ( evaluationID int PRIMARY KEY AUTO_INCREMENT, userID varchar(20), lectureName varchar(50), professorName varchar(20), lecture..
๋กœ๊ทธ์ธ, ํšŒ์›๊ฐ€์ž…, ๋กœ๊ทธ์•„์›ƒ ๊ตฌํ˜„ userLogin.jsp ํŽ˜์ด์ง€ ๋””์ž์ธ ๊ธฐ๋Šฅ ๊ตฌํ˜„ userJoin.jsp ํŽ˜์ด์ง€ ๋””์ž์ธ ๊ธฐ๋Šฅ ๊ตฌํ˜„
index.jsp ํŽ˜์ด์ง€ index.jsp ๊ธฐ๋Šฅ ๊ฐ•์˜ ํ‰๊ฐ€ ๊ฒ€์ƒ‰ ๊ฐ•์˜ ํ‰๊ฐ€ ๋“ฑ๋ก ์‹ ๊ณ ํ•˜๊ธฐ ํŽ˜์ด์ง€ ๋””์ž์ธ ๊ธฐ๋Šฅ ๊ตฌํ˜„
์›น๋””์ž์ธ ํ”„๋ ˆ์ž„์›Œํฌ - Bootstrap & jQuery ๋ถ€ํŠธ์ŠคํŠธ๋žฉ ์ ์šฉ 1) ์•„๋ž˜ ๋งํฌ์—์„œ "Compiled Css and Js" ์˜ Downloadํด๋ฆญ https://getbootstrap.com/docs/5.0/getting-started/download/ 2) ๋‹ค์šด๋กœ๋“œ ๋ฐ›์€ ํŒŒ์ผ ํ”„๋กœ์ ํŠธ์— ์‚ฌ์šฉ webapp > cssํด๋”, jsํด๋” ์ƒ์„ฑํ•˜๊ณ  bootstrap.min.cssํŒŒ์ผ๊ณผ bootstrap.min.jsํŒŒ์ผ ๋„ฃ๊ธฐ JQuery ์ ์šฉ 1) js > popper.js ํŒŒ์ผ ์ƒ์„ฑ popper.js ํŒŒ์ผ์— ์•„๋ž˜ ๋งํฌ ์ฝ”๋“œ ๋ณต๋ถ™! https://unpkg.com/popper.js@1.12.9/dist/umd/popper.min.js 2) jQuery ์„ค์น˜ ์•„๋ž˜ ๋งํฌ์—์„œ JQuery ๋‹ค์šด๋กœ๋“œ https://jquery.com/download/ jquery.min..
MySQL + JSP ์—ฐ๋™ MySQL ๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ• JSP์— MySQL ์—ฐ๋™ 1) user ํŒจํ‚ค์ง€ ์ƒ์„ฑ Java Resourses > New > Package (ํŒจํ‚ค์ง€ ๋ช… : USER ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ช…๊ณผ ๋™์ผํ•˜๊ฒŒ ์ง€์–ด์คŒ) 2) user ํŒจํ‚ค์ง€ ๋‚ด์— UserDTO, UserDAO ํด๋ž˜์Šค ์ƒ์„ฑ UserDTO(data transfer object) : jspํ”„๋กœ๊ทธ๋žจ ์•ˆ์—์„œ ์ผ์‹œ์ ์œผ๋กœ ํ•˜๋‚˜์˜ ๋ฐ์ดํ„ฐ ๋‹จ์œ„๋ฅผ ๋‹ด๊ธฐ ์œ„ํ•œ ์šฉ๋„๋กœ ์ •์˜๋œ ๊ฐ์ฒด UserDAO(data access object) : ์‹ค์งˆ์ ์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์™€ ์—ฐ๋™๋˜์–ด ์–ด๋– ํ•œ ๋‚ด์šฉ์„ ๊ธฐ๋กํ•˜๊ณ  ๊ฐ€์ ธ์˜ค๋Š” ์—ญํ• ์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฐ์ฒด 3) UserDTO.java ํŒŒ์ผ ์ฝ”๋“œ ์ž‘์„ฑ package user; public class UserDTO { String userID; String userPasswo..
๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๊ตฌ์ถ• + ํ…Œ์ŠคํŠธ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๊ตฌ์ถ• 1. ์›น ๋ธŒ๋ผ์šฐ์ € : ํฌ๋กฌ 2. ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ : JDK 3. JEE ๊ฐœ๋ฐœ ํ™˜๊ฒฝ : Eclipse 4. Tomcat ์„ค์น˜ ํ…Œ์ŠคํŠธ 1) ์ดํด๋ฆฝ์Šค์—์„œ New > "Dynamic Web Project" ์„ ํƒ 2) ์ƒ์„ฑํ•  ํ”„๋กœ์ ํŠธ ์„ค์ • 3) index.jsp ํŒŒ์ผ ์ƒ์„ฑ 4) ํ”„๋กœ์ ํŠธ ์‹คํ–‰ ๊ฒฐ๊ณผ ํ™”๋ฉด!