Ich benutze Feder mvc und ich kann nicht eine Taste zu arbeiten, wenn ich auf die Schaltfläche klicken, heißt es: Anfrage Methode 'Post' nicht unterstützt.Anfrage Methode 'POST' nicht unterstützt im Frühjahr mcv
Dies ist meine HTML-Datei:
<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>
Und das ist die Methode, die ich ausführen wollen:
@RequestMapping(value = IMAGE, method = RequestMethod.POST, params = {"add"})
public String add(HttpSession session, Model model) {
System.out.println("its working!");
return "/image/5";
}
Ich weiß, das Questen viel geschrieben wird, aber ich kann ein nicht gefunden Arbeitslösung für mich.
Fügen Sie ein Attribut 'action' in der Form '