表單使用struts標籤,表單中每個字段均可以這樣來賦值 類(action).成員變量
這個叫域模型注入post
<s:form action="orders" method="post"> <s:textfield name="orders.totalAmount" label="輸入花費金額"/> </s:form>
而後再action中須要set getthis
private Orders orders; public Orders getOrders() { return orders; } public void setOrders(Orders orders) { this.orders = orders; }