Spring

Spring MVC ๊ธฐ๋ณธ๊ธฐ๋Šฅ- HTTP ์š”์ฒญ [ ์š”์ฒญํŒŒ๋ผ๋ฏธํ„ฐ, ์š”์ฒญ๋ฉ”์‹œ์ง€]

DAHLIA CHOI 2021. 8. 18. 17:15

 

 

๐Ÿ’ฌ ํด๋ผ์ด์–ธํŠธ์—์„œ ์„œ๋ฒ„๋กœ ์š”์ฒญ ๋ฐ์ดํ„ฐ๋ฅผ ์ „๋‹ฌํ•  ๋•Œ๋Š” ์ฃผ๋กœ 3๊ฐ€์ง€ ๋ฐฉ๋ฒ•์„ ์ด์šฉํ•œ๋‹ค.

โ—พ GET - ์ฟผ๋ฆฌ ํŒŒ๋ผ๋ฏธํ„ฐ

  • /?username=hello&age=20 ์ด๋Ÿฐ ์‹์œผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.
  • ๋ฉ”์‹œ์ง€ ๋ฐ”๋”” ์—†์ด, url์˜ ์ฟผ๋ฆฌ ํŒŒ๋ผ๋ฏธํ„ฐ์— ๋ฐ์ดํ„ฐ๋ฅผ ํฌํ•จํ•ด์„œ ์ „๋‹ฌํ•œ๋‹ค.
  • ๊ฒ€์ƒ‰, ํ•„ํ„ฐ, ํŽ˜์ด์ง•์—์„œ ๋งŽ์ด ์‚ฌ์šฉ

โ—พ POST - HTML Form

  • content-type : application/x-www-form-urlencoded ํ˜•์‹
  • ๋ฉ”์‹œ์ง€ ๋ฐ”๋””์— ์ฟผ๋ฆฌ ํŒŒ๋ผ๋ฏธํ„ฐ ํ˜•์‹์œผ๋กœ ์ „๋‹ฌ (username=hello&age=20)
  • ํšŒ์›๊ฐ€์ž…, ์ƒํ’ˆ์ฃผ๋ฌธ์—์„œ ๋งŽ์ด ์‚ฌ์šฉ

โ—พ HTTP message body์— ๋ฐ์ดํ„ฐ๋ฅผ ์ง์ ‘ ๋‹ด์•„์„œ ์š”์ฒญ

  • HTTP API์—์„œ ์ฃผ๋กœ ์‚ฌ์šฉ (JSON, XML, TEXT)
  • ๋ฐ์ดํ„ฐ ํ˜•์‹์€ ์ฃผ๋กœ JSON์‚ฌ์šฉ
  • POST, PUT, PATCH

 

๐Ÿ‘‰ GET๋ฐฉ์‹๊ณผ HTML Form๋ฐฉ์‹์€ HttpServletRequest์˜ request.getParameter()์‚ฌ์šฉํ•˜๋ฉด ์š”์ฒญ ํŒŒ๋ผ๋ฏธํ„ฐ ์กฐํšŒ ๊ฐ€๋Šฅ

 

 

[ ์š”์ฒญ ํŒŒ๋ผ๋ฏธํ„ฐ ]

 

 

โ—ผ ๊ฐ€์žฅ ๊ธฐ๋ณธ์ ์ธ ์ฝ”๋“œ

@RequestMapping("/request-param-v1")
public void requestParamV1(HttpServletRequest request, HttpServletResponse response) throws IOException {
	String username = request.getParameter("username");
	int age = Integer.parseInt(request.getParameter("age"));
	log.info("username={}, age={}", username, age);
	response.getWriter().write("ok");
}
@RequestMapping์€ ์•ˆ์— ์žˆ๋Š” url๊ณผ ๋งž๋Š”๋‹ค๋ฉด ๋ฐ‘์— ์žˆ๋Š” ์ฝ”๋“œ๊ฐ€ ์‹คํ–‰๋œ๋‹ค.
GET๋ฐฉ์‹๊ณผ HTML Form ๋ฐฉ์‹์€ getParameter()๋กœ ์กฐํšŒ๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค.
response.getWriter().writer()๋Š” ํŽ˜์ด์ง€์— ์ถœ๋ ฅํ•  ๋ฌธ์ž๋ฅผ ์“ธ ์ˆ˜ ์žˆ๋‹ค.

 

 

 

โž• POST๋ฐฉ์‹์œผ๋กœ ํ•˜๋ ค๋ฉด html ํผ์„ ์ถ”๊ฐ€ํ•ด์„œ ์ „์†กํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.

 

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="/request-param-v1" method="post">
    username: <input type="text" name="username" />
    age: <input type="text" name="age" />
    <button type="submit">์ „์†ก</button>
</form>
</body>
</html>

์ด๊ณณ์— ์ •๋ณด๋ฅผ ์ž‘์„ฑํ•˜๋ฉด /request-param-v1์œผ๋กœ ์ด๋™ํ•ด์„œ ์ •๋ณด๋ฅผ ์ฒ˜๋ฆฌํ•œ๋‹ค.

 

 

 

โ—ผ getParameter() ๋Œ€์‹  ์• ๋…ธํ…Œ์ด์…˜์œผ๋กœ ๋Œ€์ฒดํ•˜๊ธฐ

@ResponseBody
@RequestMapping("/request-param-v2")
public String RequestParamV2(
	@RequestParam("username") String memberName,
	@RequestParam("age") int memberAge) {

	log.info("username={}, age={}", memberName, memberAge);
	return "ok";
}

 

โž• ๋งคํ•‘ ์ •๋ณด์™€ ๋ณ€์ˆ˜ ์ด๋ฆ„์ด ๋™์ผํ•˜๋‹ค๋ฉด ""์ด๋ฆ„๋„ ์ƒ๋žต ๊ฐ€๋Šฅ

@ResponseBody
@RequestMapping("/request-param-v3")
public String RequestParamV3(
	@RequestParam String username,
	@RequestParam int age) {
            
	log.info("username={}, age={}", username, age);
	return "ok";
}
์›๋ž˜ string์„ ํŽ˜์ด์ง€์— ์ถœ๋ ฅ๋˜๊ฒŒ ํ•˜๋ ค๋ฉด response.getWriter().write()๋ฅผ ์‚ฌ์šฉํ–ˆ์—ˆ๋Š”๋ฐ,
@ResponseBody ์• ๋…ธํ…Œ์ด์…˜์„ ์‚ฌ์šฉํ•˜๋ฉด ๊ทธ๋ƒฅ ๋ฌธ์ž์—ด๋งŒ ๋ฐ˜ํ™˜ํ•ด๋„ ๋ฌธ์ž์—ด์ด ์ถœ๋ ฅ๋œ๋‹ค.

 

 

โž• ์• ๋…ธํ…Œ์ด์…˜๋„ ์ƒ๋žต ๊ฐ€๋Šฅ ( ๋‹จ, ์š”์ฒญ ํŒŒ๋ผ๋ฏธํ„ฐ ํ˜•์‹์ด๋ž‘ ๋งž์•„์•ผ ๋œ๋‹ค. )

@ResponseBody
@RequestMapping("/request-param-v4")
public String RequestParamV4(String username, int age) { 
	log.info("username={}, age={}", username, age);
	return "ok";
}

 

 

 

โ—ผ required ์ถ”๊ฐ€

๋งคํ•‘ ์ •๋ณด๊ฐ€ ์—ฌ๋Ÿฌ ๊ฐœ์—ฌ๋„ ๊ผญ ํ•„์š”ํ•œ ์ •๋ณด์™€ ๊ผญ ํ•„์š”ํ•˜์ง€ ์•Š์€ ์ •๋ณด๊ฐ€ ์กด์žฌํ•œ๋‹ค.

๊ทธ๋Ÿด ๋•Œ๋Š” required๋ฅผ ์ถ”๊ฐ€ํ•ด์„œ ํ•„์š”ํ•œ ๊ฒƒ์ธ์ง€ ๊ผญ ํ•„์š”ํ•˜์ง€ ์•Š์€ ๊ฒƒ์ธ์ง€ ๊ตฌ๋ณ„ํ•  ์ˆ˜ ์žˆ๋‹ค.

 

true๋Š” ๊ผญ ํ•„์š”ํ•œ ์š”์†Œ, false๋Š” ์—†์–ด๋„ ๋˜๋Š” ์š”์†Œ์ด๋‹ค. 

@ResponseBody
@RequestMapping("/request-param-required")
public String RequestParamRequired(
	@RequestParam(required = true) String username,
	@RequestParam(required = false) Integer age) {

	log.info("username={}, age={}", username, age);
	return "ok";
}
์ด ์ฝ”๋“œ๋ฅผ ์‚ดํŽด๋ณด์ž๋ฉด username์€ ๊ผญ ์žˆ์–ด์•ผ ํ•˜๋Š” ํŒŒ๋ผ๋ฏธํ„ฐ์ด๊ณ , age๋Š” ์ž…๋ ฅํ•˜์ง€ ์•Š์•„๋„ ๋˜๋Š” ํŒŒ๋ผ๋ฏธํ„ฐ์ด๋‹ค.
* int๋Š” ๋””ํดํŠธ ๊ฐ’์ด null์ด ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์— Integer๋กœ ํ˜• ๋ณ€ํ™˜ํ•ด์ค€๋‹ค.

โœ ์• ๋…ธํ…Œ์ด์…˜์„ ์ƒ๋žตํ•ด๋„ ๋˜๋Š”๋ฐ ์• ๋…ธํ…Œ์ด์…˜์„ ์ƒ๋žตํ•˜๋ฉด ๋””ํดํŠธ ๊ฐ’์€ required=false๋ฅผ ์ ์šฉํ•œ๋‹ค.

 

 

localhost:8080/request-param-required?username=hello๋กœ ๊ฒ€์ƒ‰ํ•˜๋ฉด.

์ฝ˜์†”์— ์ด๋ ‡๊ฒŒ ์ถœ๋ ฅ๋œ๋‹ค.

 

 

โž• null๊ฐ™์€ ๋ณ€์ˆ˜ ๋””ํดํŠธ ๊ฐ’์ด ์•„๋‹ˆ๋ผ ๋‚ด๊ฐ€ ๋””ํดํŠธ ๊ฐ’์„ ์„ค์ •ํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด dafaultValue๊ฐ’์„ ์ง€์ •ํ•˜๋ฉด ๋œ๋‹ค.

@RequestParam(required = true, defaultValue = "guest") String username;
@RequestParam(required = false, defaultValue = "-1") int age;

์ด๋ ‡๊ฒŒ ๋ฐ”๊พธ๋ฉด ๋œ๋‹ค.

 

 

 

โ—ผ Map ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•

@ResponseBody
@RequestMapping("/request-param-map")
public String RequestParamMap(@RequestParam Map<String, Object> paramMap) {

	log.info("username={}, age={}", paramMap.get("username"), paramMap.get("age"));
	return "ok";
}
Map์œผ๋กœ ๊ฐ„๋‹จํ•˜๊ฒŒ ๋ฌถ์„ ์ˆ˜๋„ ์žˆ๋‹ค.
์ด๋ ‡๊ฒŒ ๋˜๋ฉด Map์— ์žˆ๋Š” username์ด๋ž‘ age๋ฅผ ๊ฐ€์ ธ์™€์„œ ์ถœ๋ ฅํ•œ๋‹ค.
required๋„ ์ด๋ฏธ ์„ค์ •์ด ๋˜์–ด์žˆ์–ด์„œ ๊ฐ’์„ ์ ์ง€ ์•Š์„ ๊ฒฝ์šฐ์—๋Š” null๋กœ ์ž…๋ ฅ๋œ๋‹ค.

 

โœ ํŒŒ๋ผ๋ฏธํ„ฐ ๊ฐ’์ด 1๊ฐœ๊ฐ€ ํ™•์‹คํ•˜๋‹ค๋ฉด Map์„ ์‚ฌ์šฉํ•ด๋„ ๋˜๋Š”๋ฐ ๊ทธ๋ ‡์ง€ ์•Š๋‹ค๋ฉด MultiValueMap์„ ์‚ฌ์šฉํ•˜๋Š” ํŽธ์ด ์ข‹๋‹ค.

ํ•˜์ง€๋งŒ ํŒŒ๋ผ๋ฏธํ„ฐ ๊ฐ’์ด ์—ฌ๋Ÿฌ ๊ฐœ์ผ ๊ฒฝ์šฐ๋Š” ๋ณ„๋กœ ์—†๋‹ค ( ๊ฐ™์€ key๊ฐ’์— value๊ฐ€ ์—ฌ๋Ÿฌ ๊ฐœ์ธ ๊ฒฝ์šฐ)

 

 

 

โ—ผ ModelAttribute์‚ฌ์šฉ

 

์‹ค์ œ ๊ฐœ๋ฐœ์—์„œ๋Š” ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ๋ฐ›์•„์„œ ๊ฐ์ฒด์— ๊ฐ’์„ ๋„ฃ์–ด์ฃผ๋Š”๋ฐ, ์ด ๊ณผ์ •์„ ModelAttribute๊ฐ€ ๋Œ€์‹ ํ•ด์ค€๋‹ค.

 

๋จผ์ € ํด๋ž˜์Šค๋ฅผ ํ•˜๋‚˜ ๋งŒ๋“ค์–ด๋ณด์ž.

@Data
public class HelloData {
    private String username;
    private int age;
}
์—ฌ๊ธฐ์—์„œ @Data๋Š” lombok ์• ๋…ธํ…Œ์ด์…˜์ธ๋ฐ, @Getter, @Setter, @EqualsAndHashCode, @RequiredArgsConstructor๋ฅผ ์ž๋™์œผ๋กœ ์ ์šฉํ•ด์ค€๋‹ค.

 

@ResponseBody
@RequestMapping("/model-attribute-v1")
public String modelAttributeV1(@ModelAttribute HelloData helloData) {
	log.info("username={}, age={}", helloData.getUsername(), helloData.getAge());
	return "ok";
}
์ด๋ ‡๊ฒŒ @ModelAttribute๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ž๋™์œผ๋กœ ๊ฐ์ฒด์— ํŒŒ๋ผ๋ฏธํ„ฐ ์ •๋ณด๋ฅผ ์ฃผ์ž…์‹œ์ผœ์ฃผ๊ธฐ ๋•Œ๋ฌธ์— ํŽธํ•˜๋‹ค.

 

โญ  @ModelAttribute๋Š” ์ƒ๋žต ๊ฐ€๋Šฅํ•˜๋‹ค.

 

 

 

 

[ ์š”์ฒญ ๋ฉ”์‹œ์ง€ - TEXT ]

 

์š”์ฒญ ํŒŒ๋ผ๋ฏธํ„ฐ์™€๋Š” ๋‹ค๋ฅด๊ฒŒ HTTP ๋ฉ”์‹œ์ง€ ๋ฐ”๋””๋ฅผ ํ†ตํ•ด ๋ฐ์ดํ„ฐ๊ฐ€ ์ง์ ‘ ๋„˜์–ด์˜ค๋Š” ๊ฒฝ์šฐ๋Š” @RequestParam, @ModelAttribute๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋‹ค.

 

๋Œ€์‹  InputStream์„ ์‚ฌ์šฉํ•ด์„œ ์ฝ์„ ์ˆ˜ ์žˆ๋‹ค.

InputStream์€ HTTP ์š”์ฒญ ๋ฉ”์‹œ์ง€ ๋ฐ”๋””์˜ ๋‚ด์šฉ์„ ์ง์ ‘ ์กฐํšŒํ•œ๋‹ค.

 

 

โ—ผ ๊ธฐ๋ณธ์ ์ธ ๋ฐฉ๋ฒ•

    @PostMapping ("/request-body-string-v1")
    public void requestBodyString(HttpServletRequest request, HttpServletResponse response) throws IOException {
        ServletInputStream inputStream = request.getInputStream();
        String messageBody = StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8);
        log.info("messageBody={}", messageBody);
        response.getWriter().write("ok");
    }

โญ steam์€ ๋ฐ”์ดํŠธ ์ฝ”๋“œ์—ฌ์„œ ํ•ญ์ƒ ์–ด๋–ค ์ธ์ฝ”๋”ฉ์œผ๋กœ ํ•ด์„œ ๋ฐ”๊ฟ€ ๊ฑด์ง€ ์ง€์ •ํ•ด์ค˜์•ผ ๋œ๋‹ค.

 

 

ํฌ์ŠคํŠธ๋งจ์„ ์‚ฌ์šฉํ•ด์„œ ๋ฉ”์‹œ์ง€ ๋ฐ”๋””์— ์ •๋ณด๋ฅผ ๋‹ด์•„๋ณด์ž!

 

์œ„ ์ฝ”๋“œ๋ฅผ ์ถœ๋ ฅํ•ด๋ณด๋ฉด ์ฝ˜์†”์— ์ด๋ ‡๊ฒŒ ๋‚˜์˜จ๋‹ค.

 

 

 

โ—ผ InputStream ๋ฏธ๋ฆฌ ์„ ์–ธํ•˜๊ธฐ

    @PostMapping("/request-body-string-v2")
    public void requestBodyStringV2(InputStream inputStream, Writer responseWriter) throws IOException {
        String messageBody = StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8);

        log.info("messageBody={}", messageBody);
        responseWriter.write("ok");
    }

 

 

 

โ—ผ HttpEntity ์‚ฌ์šฉ

HttpEntity๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด HTTP header, body ์ •๋ณด๋ฅผ ํŽธ๋ฆฌํ•˜๊ฒŒ ์กฐํšŒํ•  ์ˆ˜ ์žˆ๋‹ค.

    @PostMapping("/request-body-string-v3")
    public HttpEntity<String> requestBodyStringV3(HttpEntity<String> httpEntity) throws IOException {
        String messageBody = httpEntity.getBody();
        log.info("messageBody={}", messageBody);
        return new HttpEntity<>("ok");
    }
HttpEntity<String>์œผ๋กœ ํ•˜๋ฉด ๋ฌธ์ž์ธ ๊ฒƒ์„ ํ™•์ธํ•˜๊ณ , http body์— ์žˆ๋Š” ๊ฑธ ๋ฌธ์ž๋กœ ๋„˜๊ฒจ์ค€๋‹ค๋Š” ๋œป์ด๋‹ค.
http ๋ฉ”์‹œ์ง€ ์ปจ๋ฒ„ํ„ฐ๊ฐ€ ๋™์ž‘ํ•œ๋‹ค.

 

 

 

โ—ผ RequestBody ์‚ฌ์šฉ

@RequestBody๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด HTTP ๋ฉ”์‹œ์ง€ ๋ฐ”๋””์˜ ์ •๋ณด๋ฅผ ํŽธ๋ฆฌํ•˜๊ฒŒ ์กฐํšŒํ•  ์ˆ˜ ์žˆ๋‹ค.

๋งŒ์•ฝ ํ—ค๋” ๋‚ด์šฉ์ด ํ•„์š”ํ•˜๋‹ค๋ฉด ์œ„์—์„œ ์‚ฌ์šฉํ•œ HttpEntity( or @RequestHeader)๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค.

@ResponseBody
@PostMapping("/request-body-string-v4")
public String requestBodyStringV4(@RequestBody String messageBody) throws IOException {
	log.info("messageBody={}", messageBody);
	return "ok";
}

 

 

 

 

[ ์š”์ฒญ ๋ฉ”์‹œ์ง€ - JSON ]

{"username":"hello", "age":20} ์ด ๋ฐฉ๋ฒ•์ด JSON ํ˜•์‹์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด๋‚ด๋Š” ๊ฒƒ์ด๋‹ค.

 

private ObjectMapper objectMapper = new ObjectMapper();

objectMapper()๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„์—์„œ private๋ฅผ ๋จผ์ € ์„ ์–ธํ•ด์ค€๋‹ค.

 

 

โ—ผ ๊ธฐ๋ณธ์ ์ธ ๋ฐฉ๋ฒ•

    @PostMapping("/request-body-json-v1")
    public void requestBodyJsonV1(HttpServletRequest request, HttpServletResponse response) throws IOException {
        ServletInputStream inputStream = request.getInputStream();
        String messageBody = StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8);

        log.info("messageBody={}", messageBody);
        HelloData helloData = objectMapper.readValue(messageBody, HelloData.class);
        log.info("username={}, age={}", helloData.getUsername(), helloData.getAge());

        response.getWriter().write("ok");
    }

 

 

๐Ÿ‘‰ POSTMAN์œผ๋กœ ์‹คํ–‰ํ•œ ๊ฒฐ๊ณผ

์ฝ˜์†” ์ฐฝ์—๋Š” ์ด๋ ‡๊ฒŒ ์ถœ๋ ฅ๋œ๋‹ค.

 

 

โ—ผ RequestBody ์‚ฌ์šฉ

    @ResponseBody
    @PostMapping("/request-body-json-v2")
    public String requestBodyJsonV2(@RequestBody String messageBody) throws IOException {

        log.info("messageBody={}", messageBody);
        HelloData helloData = objectMapper.readValue(messageBody, HelloData.class);
        log.info("username={}, age={}", helloData.getUsername(), helloData.getAge());
        return "ok";
    }
text์— ์‚ฌ์šฉํ–ˆ๋˜  @RequestBody๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ๋‹ค.

 

 

โž• @RequestBody์— ์ง์ ‘ ๋งŒ๋“  ๊ฐ์ฒด๋ฅผ ์ง€์ •ํ•  ์ˆ˜๋„ ์žˆ๋‹ค. ๊ทธ๋Ÿผ ๊ฐ์ฒด๋ฅผ ์•ˆ์—์„œ ๋”ฐ๋กœ ์„ ์–ธํ•˜์ง€ ์•Š์•„๋„ ๋จ

    @ResponseBody
    @PostMapping("/request-body-json-v3")
    public String requestBodyJsonV3(@RequestBody HelloData data){

        log.info("username={}, age={}", data.getUsername(), data.getAge());
        return "ok";
    }

 

โญ @RequestBody๋Š” ์ƒ๋žตํ•˜๋ฉด ์ ˆ๋Œ€ ์•ˆ ๋œ๋‹ค!!!

 

 

โž• ๊ฐ์ฒด๋ฅผ ๋ฐ˜ํ™˜ํ•ด๋„ ๋œ๋‹ค.

    @ResponseBody
    @PostMapping("/request-body-json-v5")
    public HelloData requestBodyJsonV5(@RequestBody HelloData data){

        log.info("username={}, age={}", data.getUsername(), data.getAge());
        return data;
    }

์ด๋ ‡๊ฒŒ ๋ฐ˜ํ™˜๋œ ๊ฐ์ฒด์˜ ์ •๋ณด๊ฐ€ ํŽ˜์ด์ง€์— ์ถœ๋ ฅ๋œ๋‹ค.

 

 

 

โ—ผ HttpEntity ์‚ฌ์šฉ

์•ž์—์„œ ์‚ฌ์šฉํ–ˆ๋˜ HttpEntity๋ฅผ ์‚ฌ์šฉํ•ด๋„ ๋œ๋‹ค.

    @ResponseBody
    @PostMapping("/request-body-json-v4")
    public String requestBodyJsonV4(HttpEntity<HelloData> httpEntity){
        HelloData data = httpEntity.getBody();
        log.info("username={}, age={}", data.getUsername(), data.getAge());

        return "ok";
    }

 

 

 

 


์Šคํ”„๋ง mvc๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด์„œ ์Šคํ”„๋ง์ด ์ œ๊ณตํ•ด์ฃผ๋Š” ๊ธฐ๋Šฅ๋“ค์„ ์‚ฌ์šฉํ•˜๋ฉด์„œ ์ฝ”๋“œ์˜ ๊ธธ์ด๋ฅผ ์ค„์—ฌ๋‚˜๊ฐ€๋‹ˆ๊นŒ ์™œ ์Šคํ”„๋ง์„ ์‚ฌ์šฉํ•˜๋Š”์ง€ ๋˜ ํ•œ ๋ฒˆ ๋Š๊ผˆ๋‹ค... ์˜คํžˆ๋ ค ๋„ˆ๋ฌด ๋งŽ์€ ๋ฐฉ๋ฒ•์ด ์žˆ์–ด์„œ ํ—ท๊ฐˆ๋ฆด ์ง€๊ฒฝ์ด๋‹คใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ ๋‚œ ์งง์€ ๊ฒŒ ์ข‹์•„!

 

์ด ํฌ์ŠคํŒ…์€ ์ธํ”„๋Ÿฐ ๊น€์˜ํ•œ๋‹˜์˜ [์Šคํ”„๋งMVC 1ํŽธ - ๋ฐฑ์—”๋“œ ์›น๊ฐœ๋ฐœ ํ•ต์‹ฌ ๊ธฐ์ˆ ]์„ ๋“ฃ๊ณ  ์ž‘์„ฑ๋œ ๋ณต์Šต ๊ฒธ ์ •๋ฆฌ ํฌ์ŠคํŒ…์ž…๋‹ˆ๋‹ค.