기본프로젝트
=================
완료프로젝트
=================================이론=====================================
p394
p412
p416
//@Valid @InitBinder 와 연동해서 검증을 해줌
@RequestMapping(value="/update.do", method=RequestMethod.POST)
public String submit(@Valid MemberCommand memberCommand, BindingResult result){
if(result.hasErrors()){
return formViewName;
}
memberDao.updateMember(memberCommand);
return "redirect:/list.do";
}
@InitBinder //initBinder 검증 등록
protected void initBinder(WebDataBinder binder){
binder.setValidator(new MemberValidator());
}
@RequestMapping(value="/update.do", method=RequestMethod.POST)
public String submit(@Valid MemberCommand memberCommand, BindingResult result){
if(result.hasErrors()){
return formViewName;
}
memberDao.updateMember(memberCommand);
return "redirect:/list.do";
}
@InitBinder //initBinder 검증 등록
protected void initBinder(WebDataBinder binder){
binder.setValidator(new MemberValidator());
}
===============================프로젝트===================================
=================================코드=====================================
===============================출력결과===================================
DB MEMBER1 테이블
멤버등록
리스트뿌리기
상세보기
수정하기
삭제하기
'스프링3.0' 카테고리의 다른 글
스프링 3.0 AOP 에러. 문제 해결 (1) | 2012.05.15 |
---|---|
Spring3.0 Tiles (1) | 2012.05.14 |
Spring3.0 View error filedown (0) | 2012.05.14 |
Spring3.0 MVC 웹요청 처리 (0) | 2012.05.14 |
Spring 3.0 AOP (0) | 2012.05.14 |