[英]Submit button does nothing when clicked
當提交按鈕被點擊時,什么也沒有發生。 只點擊,不會調用控制器方法。 完全不知道為什么。 我嘗試了多種提交方法。 外部形式和內聯形式。
<table border="1">
<tr>
<td><spring:message code="label.id" /></td>
<td><spring:message code="label.name" /></td>
<td><spring:message code="label.abv" /></td>
<td><spring:message code="label.Buy" /></td>
<td><spring:message code="label.Sell" /></td>
<td><spring:message code="label.LastMod" /></td>
<td><spring:message code="label.Description" /></td>
<td><spring:message code="label.image" /></td>
<td><spring:message code="label.catagory" /></td>
<td><spring:message code="label.style" /></td>
<td><spring:message code="label.actions" /></td>
</tr>
<c:forEach items="${Beers}" var="Beers">
<tr>
<td>${Beers.id}</td>
<td>${Beers.name}</td>
<td>${Beers.abv}</td>
<td>${Beers.buyPrice}</td>
<td>${Beers.sellPrice}</td>
<td>${Beers.lastMod}</td>
<td>${Beers.description}</td>
<td><img src="../assets/images/no_image.jpg" alt="<spring:message code="label.image" />"/></td>
<td>${Beers.catId}</td>
<td>${Beers.styleId}</td>
<td>
//PROBLEM HERE
<form:form method="POST" action="/TasteLimerickBeersB/Beers/UpdateBeerPrice?id=${Beers.id}" modelAttribute="priceIncrease">
<label for="priceIncrease"><spring:message code="label.percentage" /></label>
<input type="text" name="priceIncrease" maxlength="4" max="100" pattern="[+-?0-9]+([\.][0-9]{0,2})?">
<button type="submit" value="Submit!"><spring:message code="submit.button" /></button>
</form:form>
</td>
</tr>
</c:forEach>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 任何落入相同陷阱的人都缺少這一行......
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.