IllegalStateExceptionが出る箇所(バリデータ)の修正
@@ -80,7 +80,7 @@ | ||
80 | 80 | } |
81 | 81 | |
82 | 82 | @Aspect(value="loginConfInterceptor") |
83 | - @Execute(validator = true,input="update/{id}",stopOnValidationError=true,validate="createValidate") | |
83 | + @Execute(validator = true,input="update/{id}",stopOnValidationError=false,validate="createValidate") | |
84 | 84 | public String updateComplete(){ |
85 | 85 | player=playerService.findById(Integer.parseInt(playerForm.id)); |
86 | 86 | player.id=Integer.parseInt(playerForm.id); |
@@ -104,11 +104,11 @@ | ||
104 | 104 | public ActionMessages createValidate(){ |
105 | 105 | ActionMessages errors = new ActionMessages(); |
106 | 106 | player=playerService.findByNameAndTeamId(playerForm.name, Integer.parseInt(playerForm.teamId)); |
107 | - if(player!=null){ | |
108 | - if(player.comment.equals(playerForm.comment)){ | |
109 | - errors.add("name", new ActionMessage("既に登録されています", false)); | |
110 | - } | |
111 | - | |
107 | + if(player!=null && playerForm.comment.equals(player.comment)){ | |
108 | + /* 既に選手リストに登録されていて、 | |
109 | + * DBのコメントとフォームのコメントが同じ場合エラー | |
110 | + */ | |
111 | + errors.add("name", new ActionMessage("既に登録されています", false)); | |
112 | 112 | } |
113 | 113 | return errors; |
114 | 114 | } |