私は春に選択したコンボボックスの値を受け取る方法を見つけるのに苦労しています。春のコンボボックスから値を取得
これは、HTMLフォームです:ボタンがクリックされた後
<form method="post" multiple="true">
Authhor: <label th:text="*{ownerName}" /><br />
Title: <label th:text="*{name}" /><br />
Description: <label th:text="*{description}" /><br />
Price: €<label th:text="*{price}" /><br />
Product: <select th:field="${productss}" th:remove="all-but-first">
<option th:each="product : ${productss}"
th:value="${product.id}" th:text="${product.name + ' (+ €' + product.price + ')'}">Productname</option>
</select><br />
<img width="250" heigth="250" th:src="*{plainURL}"/><br />
<button align="right" class="btn" type="submit" name="add" ><span class="glyphicon glyphicon-check">Add to shopping cart</span></button><br />
</form>
、このmethedは、コントローラで実行されます。
@RequestMapping(value = IMAGE_ID, method = RequestMethod.POST, params = {"add"})
public String add(@PathVariable("id") int id, HttpSession session, Model model) {
...
return "redirect:/cart";
}
私はその中にコンボボックスから選択した値を受け取ることができますどのように方法?このような
は、使用してみてくださいでした。<フォーム:選択パス= "製品"> –