我要从thymeleaf提交一个表单,然后尝试在控制器上读取模型,但是它不起作用
<form action="#" th:action="@{/activate}" th:object="${complete_map}" method="post">
<p><input type="submit" value="Submit" /> <input type="reset" value="Reset" /></p>
</form>
@PostMapping("/activate")
public String greetingSubmit(Model m) {
System.out.println("Got the map and the siz");
System.out.println("received size on map is "+m.asMap().size());
return "telco";
}
正在打印:
received size on map is 0 , despite the map size is 3 when i redirecting from other controller.