File tree Expand file tree Collapse file tree
spring-mybatis/src/main/java/com/baeldung/spring/mybatis/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change 642642 <module >spring-mobile</module >
643643 <!-- <module>spring-mustache</module> --><!-- PMD voilation -->
644644 <module >spring-mvc-simple</module >
645- <!-- < module>spring-mybatis</module> --><!-- Compilation failure -- >
645+ <module >spring-mybatis</module >
646646 <module >spring-rest-hal-browser</module >
647647 <module >spring-rest-shell</module >
648648 <module >spring-rest-template</module >
959959 <module >spring-mobile</module >
960960 <!-- <module>spring-mustache</module> --><!-- PMD voilation -->
961961 <module >spring-mvc-simple</module >
962- <!-- < module>spring-mybatis</module> --><!-- Compilation failure -- >
962+ <module >spring-mybatis</module >
963963 <module >spring-rest-hal-browser</module >
964964 <module >spring-rest-shell</module >
965965 <module >spring-rest-template</module >
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public String signup(Model model) {
3131
3232 @ RequestMapping (value = "/signup" , method = RequestMethod .POST )
3333 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 ) {
3535 model .addAttribute ("message" , "User Name exists. Try another user name" );
3636 return "signup" ;
3737 } else {
@@ -50,7 +50,7 @@ public String login(Model model) {
5050
5151 @ RequestMapping (value = "/login" , method = RequestMethod .POST )
5252 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 ;
5454 if (found ) {
5555 return "success" ;
5656 } else {
You can’t perform that action at this time.
0 commit comments