所以我们正在为我们的项目进行登录。我们遇到的问题是我们只在参数中得到 null 而不是我们输入的实际值。有人知道为什么吗?
控制器代码:
@RequestMapping(value = "/user/login",method = RequestMethod.POST)
public String logIn(@ModelAttribute("user") User user) {
//Random code here
return "redirect:/general/index.html";
}
看法:
<form:form id="header_login_form" method="POST" ModelAttribute="user" action="/ProjectTeamF-1.0/user/login.html">
<input path="username"class="input" placeholder="Email" />
<input path="password" class="input" placeholder="Password" />
<label class="checkbox">
<input type="checkbox"> Aangemeld blijven</label>
<button type="submit" class="btn">Aanmelden</button>
</form:form>