Action代码:
public class ProductAction extends ActionSupport implements ModelDriven<Product> {
/**
*
*/
private static final long serialVersionUID = -2947866505600195157L;
//模型驱动使用的类
private Product product = new Product();
@Override
public Product getModel() {
return product;
JSP代码:
<s:form action="product_save" method="post" namespace="/" theme="simple">
<table border="1" width="400">
<tr>
<td>商品的名称</td>
<td><input name="pName"/></td>
</tr>
<tr>
<td>商品的价格</td>
<td><input name="pPrice"/></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="添加"/></td>
</tr>
</table>
</s:form>
qq_静静的垭口_03935456
qq_静静的垭口_03935456
大咪
大咪
相关分类