我已经包含了主页和相应的登录控制器。 单击主页上的按钮,我无法将用户重定向到登录页面。
home.html
<div class="container">
<form th:action="@{/login}" method="post" role="form">
<center><h1 class="text-muted">WELCOME</h1><center>
<hr/>
<input type="submit" class="btn btn-success" value="Proceed"/>
</form>
</div>
logincontroller.java
@RequestMapping(value = "/login")
@ResponseBody
public ModelAndView login(@ModelAttribute String emailaddress ) {
System.out.println("helllooo");
ModelAndView mav = new ModelAndView("login");
mav.addObject("emailaddress", emailaddress);
mav.setViewName("login");
return mav;
}