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

form2

[HTTP] HTTP ๋ฉ”์„œ๋“œ ํ™œ์šฉ ํด๋ผ์ด์–ธํŠธ์—์„œ ์„œ๋ฒ„๋กœ ๋ฐ์ดํ„ฐ ์ „์†ก ๋ฐ์ดํ„ฐ ์ „๋‹ฌ ๋ฐฉ์‹์€ ํฌ๊ฒŒ 2๊ฐ€์ง€ ์ฟผ๋ฆฌ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ํ†ตํ•œ ๋ฐ์ดํ„ฐ ์ „์†ก GET ์ฃผ๋กœ ์ •๋ ฌ ํ•„ํ„ฐ(๊ฒ€์ƒ‰์–ด) ๋ฉ”์‹œ์ง€ ๋ฐ”๋””๋ฅผ ํ†ตํ•œ ๋ฐ์ดํ„ฐ ์ „์†ก POST, PUT, PATCH ํšŒ์› ๊ฐ€์ž…, ์ƒํ’ˆ ์ฃผ๋ฌธ, ๋ฆฌ์†Œ์Šค ๋“ฑ๋ก, ๋ฆฌ์†Œ์Šค ๋ณ€๊ฒฝ 4๊ฐ€์ง€ ์ƒํ™ฉ์„ ์˜ˆ๋กœ ๋“ค์–ด ์ƒ๊ฐํ•ด๋ด…์‹œ๋‹ค...! 1. ์ •์  ๋ฐ์ดํ„ฐ ์กฐํšŒ ์ด๋ฏธ์ง€, ์ •์  ํ…์ŠคํŠธ ๋ฌธ์„œ ์ •์  ๋ฐ์ดํ„ฐ ์กฐํšŒ๋Š” ์ฟผ๋ฆฌ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์กฐํšŒ๋Š” GET ์‚ฌ์šฉ ์ •์  ๋ฐ์ดํ„ฐ๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ ์ฟผ๋ฆฌ ํŒŒ๋ผ๋ฏธํ„ฐ ์—†์ด ๋ฆฌ์†Œ์Šค ๊ฒฝ๋กœ๋กœ ๋‹จ์ˆœํ•˜๊ฒŒ ์กฐํšŒ ๊ฐ€๋Šฅ 2. ๋™์  ๋ฐ์ดํ„ฐ ์กฐํšŒ ์ฃผ๋กœ ๊ฒ€์ƒ‰, ๊ฒŒ์‹œํŒ ๋ชฉ๋ก์—์„œ ์ •๋ ฌ ํ•„ํ„ฐ(๊ฒ€์ƒ‰์–ด) ์กฐํšŒ ์กฐ๊ฑด์„ ์ค„์—ฌ์ฃผ๋Š” ํ•„ํ„ฐ, ์กฐํšŒ ๊ฒฐ๊ณผ๋ฅผ ์ •๋ ฌํ•˜๋Š” ์กฐ๊ฑด์— ์ฃผ๋กœ ์‚ฌ์šฉ ์กฐํšŒ๋Š” GET ์‚ฌ์šฉ GET์€ ์ฟผ๋ฆฌ ํŒŒ๋ผ๋ฏธํ„ฐ ์‚ฌ์šฉํ•ด์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ „๋‹ฌ 3. HTM.. 2023. 7. 19.
Spring - ์›น MVC ์˜ˆ์ œ (ํšŒ์› ๋“ฑ๋ก) ํšŒ์› ๋“ฑ๋ก ํผ ์ปจํŠธ๋กค๋Ÿฌ ์ƒ์„ฑ @Controller public class MemberController { // private final MemberService memberService = new MemberService(); private final MemberService memberService; //์ปจํŠธ๋กค๋Ÿฌ์™€ ์„œ๋น„์Šค๋ฅผ ์—ฐ๊ฒฐ @Autowired public MemberController(MemberService memberService) { this.memberService = memberService; } @GetMapping("/members/new") public String createForm() { return "members/createMemberForm"; } @PostMapping(.. 2023. 7. 4.