0
스프링 mvc를 사용하고 있는데 버튼을 클릭하면 작동 할 수 없습니다. 요청 방법 'Post'가 지원되지 않습니다. 요청 방법 'POST'는 Spring mcv에서 지원되지 않습니다.
이
내 HTML 파일입니다<html>
<head>
<title>Cart</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body th:object="${picture}">
<form method="post">
Authhor: <label th:text="*{ownerName}" /><br />
Title: <label th:text="*{title}" /><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>
</body>
</html>
그리고 이것은 내가 실행하고자하는 방법입니다 :
@RequestMapping(value = IMAGE, method = RequestMethod.POST, params = {"add"})
public String add(HttpSession session, Model model) {
System.out.println("its working!");
return "/image/5";
}
나는이 questen 많이 게시 알고,하지만 난을 찾을 수 없습니다 나를 위해 일하는 해결책.
'