Spring/Spring MVC

Spring/Spring MVC

[์Šคํ”„๋ง MVC] - 2. ์„œ๋ธ”๋ฆฟ ๋“ฑ๋กํ•˜๊ณ  ์‚ฌ์šฉํ•˜๊ธฐ

์Šคํ”„๋ง ๋ถ€ํŠธ ํ™˜๊ฒฝ์—์„œ ์„œ๋ธ”๋ฆฟ ๋“ฑ๋กํ•˜๊ณ  ์‚ฌ์šฉํ•ด๋ณด์ž. @ServletComponentScan @SpringBootApplication public class ServletApplication { @ServletComponentScan ์Šคํ”„๋ง ๋ถ€ํŠธ๋Š” ์„œ๋ธ”๋ฆฟ์„ ์ง์ ‘ ๋“ฑ๋กํ•ด์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก @ServletComponentScan ์„ ์ง€์›ํ•œ๋‹ค. @WebServlet(name = "helloServlet", urlPatterns = "/hello") public class HelloServlet extends HttpServlet { @WebServlet ์„œ๋ธ”๋ฆฟ ์• ๋…ธํ…Œ์ด์…˜ name: ์„œ๋ธ”๋ฆฟ ์ด๋ฆ„ urlPatterns: URL ๋งคํ•‘ @Override protected void service(HttpServletRe..

Spring/Spring MVC

[์Šคํ”„๋ง MVC] - 1. ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ดํ•ด

์„น์…˜ 1. ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ดํ•ด ์›น - HTTP ๊ธฐ๋ฐ˜ ( HyperText Transfer Protocol ) ์›น์ƒ์—์„œ ๋„คํŠธ์›Œํฌ๋กœ ์„œ๋ฒ„๋ผ๋ฆฌ ํ†ต์‹ ์„ ํ• ๋•Œ ์–ด๋– ํ•œ ํ˜•์‹์œผ๋กœ ์„œ๋กœ ํ†ต์‹ ์„ ํ•˜์ž๊ณ  ๊ทœ์ •ํ•ด ๋†“์€ "ํ†ต์‹  ํ˜•์‹" ํ˜น์€ "ํ†ต์‹  ๊ตฌ์กฐ" ๋ผ๊ณ  ๋ณด๋ฉด ๋œ๋‹ค. HTTP ๊ธฐ๋ณธ์ ์œผ๋กœ request(์š”์ฒญ)/response(์‘๋‹ต) ๊ตฌ์กฐ๋กœ ๋˜์–ด์žˆ๋‹ค. ํด๋ผ์ด์–ธํŠธ๊ฐ€ HTTP request๋ฅผ ์„œ๋ฒ„์— ๋ณด๋‚ด๋ฉด ์„œ๋ฒ„๋Š” HTTP response๋ฅผ ๋ณด๋‚ด๋Š” ๊ตฌ์กฐ ํด๋ผ์ด์–ธํŠธ์™€ ์„œ๋ฒ„์˜ ๋ชจ๋“  ํ†ต์‹ ์ด ์š”์ฒญ๊ณผ ์‘๋‹ต์œผ๋กœ ์ด๋ฃจ์–ด ์ง„๋‹ค. request(์š”์ฒญ) response(์‘๋‹ต) ์›น ์„œ๋ฒ„, ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„œ๋ฒ„(WAS) ์ฐจ์ด ์›น ์„œ๋ฒ„๋Š” ์ •์  ๋ฆฌ์†Œ์Šค(ํŒŒ์ผ) WAS๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋กœ์ง ์„œ๋ธ”๋ฆฟ HTTP ์š”์ฒญ/์‘๋‹ต ์ •๋ณด๋ฅผ ํŽธ๋ฆฌํ•˜๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•จ ์›น์„ ..

hello_u
'Spring/Spring MVC' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (3 Page)