1. 스프링에서 컨트롤러에서 view 에 데이터를 전달 하는 방법 2가지를 설명하시오.
@Controller public class Controller1 { public String method1(Model model) { model.addAttribute("data", data);
@RestController public class RestController2 { public String method2(@RequestParam("var") String var) { return service2.method2(var);
2.아래의 객체를 설명하시오.
- Model x : Store attributes and transfer the data between the view and the controller of Spring MVC application.
- ModelAndView : Plus this one contains view. It is required
return
to transfer the data it has.