package sg.ncl;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class SimpleController {
    
    DummyJavaSpiBinder myJavaBinder = new DummyJavaSpiBinder();
    
    @RequestMapping(value="/", method=RequestMethod.GET)
    public String index(Model model) throws Exception {
        model.addAttribute("loginForm", new LoginForm());
        return "index";
    }
    
    @RequestMapping(value="/", method=RequestMethod.POST)
    public String loginSubmit(@ModelAttribute LoginForm loginForm, Model model) throws Exception {
        model.addAttribute("loginForm", loginForm);
        return "redirect:/dashboard";
    }
    
    @RequestMapping("/signup")
    public String signup() {
        return "signup";
    }
    
    @RequestMapping("/passwordreset")
    public String passwordreset() {
        return "passwordreset";
    }
    
    @RequestMapping("/dashboard")
    public String dashboard() {
        return "dashboard";
    }
    
    @RequestMapping(value="/logout", method=RequestMethod.GET)
    public String logout() {
        return "redirect:/";
    }
}
@@ -338,16 +338,98 @@
     %0A   
+ JavaSpiBinder myJavaBinder = new JavaSpiBinder(%22192.168.56.103%22, %2252323%22);%0A    //
  DummyJa
@@ -1006,20 +1006,188 @@
  signup(
+Model model
 ) %7B%0A
+        // forms has to be added for other views, because the loginForm also exists on those pages%0A        model.addAttribute(%22loginForm%22, new LoginForm());%0A
         
@@ -1284,19 +1284,88 @@
 rdreset(
-) %7B
+Model model) %7B%0A        model.addAttribute(%22loginForm%22, new LoginForm());
 %0A       

fix login form thymeleaf error (#3)