@ModelAttribute[(“사용할 이름”)]
/* StudentVO.class */
private String name;
private int age;
/* Controller.class */
public void test(@ModelAttribute StudentVO studentVO){
model.addAttribute(“StudentVO”,studentVO) // 생략가능
}
/* view.jsp */
${studentVO.name}
${studentVO.age}
혹은
/* Controller.class */
public void test(@ModelAttribute(“test”) StudentVO studentVO){
model.addAttribute(“StudentVO”,studentVO) // 생략가능
}
/* view.jsp */
${test.name}
${test.age}
@RequestParam(value=”파라미터name” defaultValue=”디폴트값”, required=”필수인지true/false” )
// @RequestParam
public void test ( @RequestParam(“name”)String name, @RequestParam(“no”)int no ) { … }
// @ModelAttribute
public void test ( @ModelAttribute StudentVO studentVO ) { … }