0
有人可以幫我這個錯誤無論BindingResult也不是爲bean名稱平原目標對象zipbean'可以作爲請求屬性
的index.jsp
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<html>
<head>
<body>
<jsp:include page="links.jsp"/>
<script src="<%=request.getContextPath()%>/js/welcome.js"></script>
<form:form action="${pageContext.request.contextPath}/Customer" method="POST" modelAttribute="zipbean">
<input type="text" id="zip" name="zip" class="form-control search ui-autocomplete" onkeypress=" return validate(event)" onkeydown="getData('${pageContext.request.contextPath}/ZipController/autoComplete');" />
<form:button path="zipone" class="btn btn-success">Get a Quote</form:button>
</center>
</form:form>
</body>
</html>
CustomerController
@Controller
@RequestMapping("/Customer")
public class CustomerController
{
@Autowired
ZipDao zipDao;
@RequestMapping(method = RequestMethod.GET)
public String init(HttpServletRequest request,HttpServletResponse responce,ModelMap model)
{
System.out.println("customer page started");
ZipBean zipbean=new ZipBean();
model.addAttribute("zipbean", zipbean);
return "customer";
}
}
而且我有一些文本框客戶頁面顯示
如果在同一個jsp中有select屬性會怎麼樣。我必須添加表單:select? –
是 - 看看春天的文檔,但語法是99%類似於經典的標籤:)主要是名稱= 屬性中的路徑 – niilzon