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

Spring MVC2

[ํ•ด์ปคํ†ค][ํ˜ธ๋‚จ์˜ ์–ผ๊ตด]์–ผ๊ตด์ธ์‹ ์ถœ์„ ์„œ๋น„์Šค ๋ณธ ํ”„๋กœ์ ํŠธ๋Š” ์˜คํ”ˆ ์†Œ์Šค๋กœ ๊ณต๊ฐœํ•ด๋‘์—ˆ์Šต๋‹ˆ๋‹ค๐Ÿคญ ๐Ÿ‘‡๐Ÿป ํด๋ฆญํ•ด์ฃผ์„ธ์šฉ ๐Ÿ‘‡๐Ÿป ๊นƒํ—ˆ๋ธŒ ์ฃผ์†Œ 2023. 9. 4.
[Spring] ์Šคํ”„๋ง MVC ๊ธฐ๋ณธ ๊ธฐ๋Šฅ @RestController @Controller ๋Š” ๋ฐ˜ํ™˜ ๊ฐ’์ด String ์ด๋ฉด ๋ทฐ ์ด๋ฆ„์œผ๋กœ ์ธ์‹๋œ๋‹ค. ๊ทธ๋ž˜์„œ ๋ทฐ๋ฅผ ์ฐพ๊ณ  ๋ทฐ๊ฐ€ ๋žœ๋”๋ง ๋œ๋‹ค. @RestController ๋Š” ๋ฐ˜ํ™˜ ๊ฐ’์œผ๋กœ ๋ทฐ๋ฅผ ์ฐพ๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ, HTTP ๋ฉ”์‹œ์ง€ ๋ฐ”๋””์— ๋ฐ”๋กœ ์ž…๋ ฅํ•œ๋‹ค. ๋”ฐ๋ผ์„œ ์‹คํ–‰ ๊ฒฐ๊ณผ๋กœ ok ๋ฉ”์„ธ์ง€๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค. @RequestMapping์— method ์†์„ฑ์œผ๋กœ HTTP ๋ฉ”์„œ๋“œ๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š์œผ๋ฉด HTTP ๋ฉ”์„œ๋“œ์™€๋Š” ๋ฌด๊ด€ํ•˜๊ฒŒ ํ˜ธ์ถœ๋œ๋‹ค. /** * method ํŠน์ • HTTP ๋ฉ”์„œ๋“œ ์š”์ฒญ๋งŒ ํ—ˆ์šฉ * GET, HEAD, POST, PUT, PATCH, DELETE */ @RequestMapping(value = "/mapping-get-v1", method = RequestMethod.GET) public String m.. 2023. 8. 7.