클라이언트(jsp)에서 보내온 데이터를 컨트롤러에서 VO 나 변수로 담을 수 있는 어노테이션은 @ModelAttribute, @RequestParam이다.
@ModelAttribute은 여러개의 값을 VO로 한번에 담을 수 있다.
public String test(@ModelAttribute MemberVO memberVO) throws Exception{
System.out.println(memberVO.toString());
}
@RequestParam은 객체에 담지 않고 변수에 담는다.
public String test(@RequestParam("id") String id, @RequestParam("pw") String pw, ) throws Exception{
System.out.println(id + pw);
}
'WEB > SPRING' 카테고리의 다른 글
jsonView 사용법 (0) | 2020.01.07 |
---|---|
egovframework maven error (0) | 2019.12.09 |