MCPcopy Create free account
hub / github.com/castello/spring_basic / save

Method save

ch3/RegisterController.java:38–50  ·  view source on GitHub ↗
(@Valid User user, BindingResult result, Model m)

Source from the content-addressed store, hash-verified

36 }
37
38 @PostMapping("/add")
39 public String save(@Valid User user, BindingResult result, Model m) throws Exception {
40 System.out.println("result="+result);
41 System.out.println("user="+user);
42
43 // User객체를 검증한 결과 에러가 있으면, registerForm을 이용해서 에러를 보여줘야 함.
44 if(result.hasErrors()) {
45 return "registerForm";
46 }
47
48 // 2. DB에 신규회원 정보를 저장
49 return "registerInfo";
50 }
51
52 private boolean isValid(User user) {
53 return true;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected