「Spring MVC」@Controllerで戻り値を取得する

1.戻り値 ModelAndView

@RequestMapping("/create")
 public ModelAndView create() {
       ModelAndView mav = new ModelAndView();
       mav.addObject(new Employee("emp001", "emp002","emp003"));
       mav.setViewName("/top.do");
       return mav;
   }

2.戻り値 String

@RequestMapping("/update")
   public String update() {
       return "/top.do";
   }

 

SpringMVC

Posted by arkgame