如何将模型的对象传递给胸腺细胞,并将其传递给隐藏在胸腺细胞中的控制者?
model.addAttribute("member", member);
model.addAttribute("item", item);
model.addAttribute("poi", poi);
model.addAttribute("myModel", myModel);
model.addAttribute("allPlans", allPlans);
model.addAttribute("allPois", allPois);
model.addAttribute("itemParam",itemParam);我是controller1。
controller1将7个对象传递给项。
<input type="hidden" th:field=${member}>
<input type="hidden" th:field=${item}>
<input type="hidden" th:field=${poi}>
<input type="hidden" th:field=${myModel}>
<input type="hidden" th:field=${allPlans}>
<input type="hidden" th:field=${allPois}>
<input type="hidden" th:field=${itemParam}>这是胸腺的密码。
结果如下:
<input type="hidden" id="" name="" value="">
<input type="hidden" id="" name="" value="">
<input type="hidden" id="" name="" value="">
<input type="hidden" id="" name="" value="">
<input type="hidden" id="" name="" value="">
<input type="hidden" id="" name="" value="">
<input type="hidden" id="" name="" value="">如何将7个完整的对象传递给控制器?
发布于 2021-10-08 06:32:26
我认为有两种方法可以做到:
不要使用th:field,而是使用html、id和name。使用th:value设置值
<input type="hidden" id="yourId1" name="yourName1" th:value="${item}"><input type="hidden" th:field="__${item}__">https://stackoverflow.com/questions/69490976
复制相似问题