File tree 2 files changed +4
-4
lines changed
spring-mybatis/src/main/java/com/baeldung/spring/mybatis/controller
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 643
643
<module >spring-mobile</module >
644
644
<!-- <module>spring-mustache</module> --><!-- PMD voilation -->
645
645
<module >spring-mvc-simple</module >
646
- <!-- < module>spring-mybatis</module> --><!-- Compilation failure -- >
646
+ <module >spring-mybatis</module >
647
647
<module >spring-rest-hal-browser</module >
648
648
<module >spring-rest-shell</module >
649
649
<module >spring-rest-template</module >
960
960
<module >spring-mobile</module >
961
961
<!-- <module>spring-mustache</module> --><!-- PMD voilation -->
962
962
<module >spring-mvc-simple</module >
963
- <!-- < module>spring-mybatis</module> --><!-- Compilation failure -- >
963
+ <module >spring-mybatis</module >
964
964
<module >spring-rest-hal-browser</module >
965
965
<module >spring-rest-shell</module >
966
966
<module >spring-rest-template</module >
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public String signup(Model model) {
31
31
32
32
@ RequestMapping (value = "/signup" , method = RequestMethod .POST )
33
33
public String signup (@ Validated @ ModelAttribute ("student" ) Student student , BindingResult result , ModelMap model ) {
34
- if (studentService .getStudentByUserName (student .getUserName ())) {
34
+ if (studentService .getStudentByUserName (student .getUserName ()) != null ) {
35
35
model .addAttribute ("message" , "User Name exists. Try another user name" );
36
36
return "signup" ;
37
37
} else {
@@ -50,7 +50,7 @@ public String login(Model model) {
50
50
51
51
@ RequestMapping (value = "/login" , method = RequestMethod .POST )
52
52
public String login (@ ModelAttribute ("studentLogin" ) StudentLogin studentLogin , BindingResult result , ModelMap model ) {
53
- boolean found = studentService .getStudentByLogin (studentLogin .getUserName (), studentLogin .getPassword ());
53
+ boolean found = studentService .getStudentByLogin (studentLogin .getUserName (), studentLogin .getPassword ()) != null ;
54
54
if (found ) {
55
55
return "success" ;
56
56
} else {
You can’t perform that action at this time.
0 commit comments