struts--批量封装对象

Struts1.2应用-批量封装对象

                                                                      ++YONG原创,转载请注明

1.    批量发布产品信息效果图:<v:shapetype o:spt="75" coordsize="21600,21600" filled="f" stroked="f" id="_x0000_t75" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t"> <v:shapetype o:spt="75" coordsize="21600,21600" filled="f" stroked="f" id="_x0000_t75" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t"> </v:shapetype></v:shapetype>

<v:shapetype o:spt="75" coordsize="21600,21600" filled="f" stroked="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t"><v:shapetype o:spt="75" coordsize="21600,21600" filled="f" stroked="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" o:connecttype="rect" gradientshapeok="t"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style="WIDTH: 396pt; HEIGHT: 255.75pt"><v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.png" o:title=""></v:imagedata></v:shape><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" o:connecttype="rect" gradientshapeok="t"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style="WIDTH: 396pt; HEIGHT: 255.75pt"><v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.png" o:title=""></v:imagedata></v:shape>

<v:shapetype o:spt="75" coordsize="21600,21600" filled="f" stroked="f" id="_x0000_t75" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" o:connecttype="rect" gradientshapeok="t"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style="WIDTH: 396pt; HEIGHT: 255.75pt"><v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.png" o:title=""></v:imagedata></v:shape>

上图为批量发布产品页面。

<v:shape id="_x0000_i1026" type="#_x0000_t75" style="WIDTH: 396pt; HEIGHT: 255pt"><v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtmlclip1\01\clip_image003.png" o:title=""></v:imagedata></v:shape>

上图为显示刚批量发布的产品页面。

2.    具体实现:

2.1.    域模型对象:Product.java<o:p></o:p>

package org.qiujy.domain;<o:p></o:p>

<o:p> </o:p>

import java.sql.Date;<o:p></o:p>

<o:p> </o:p>

/**<o:p></o:p>

 * 产品---实体域模型类<o:p></o:p>

 * @author qiujy<o:p></o:p>

 * @version 1.0<o:p></o:p>

 */<o:p></o:p>

public class Product {<o:p></o:p>

    private Long id;<o:p></o:p>

    private String name;<o:p></o:p>

    private double price;<o:p></o:p>

    private Date pubTime = new Date(new java.util.Date().getTime());<o:p></o:p>

<o:p> </o:p>

    public Product() {<o:p></o:p>

    }<o:p></o:p>

<o:p> </o:p>

    public Product(Long id, String name, double price, Date pubTime) {<o:p></o:p>

        this.id = id;<o:p></o:p>

        this.name = name;<o:p></o:p>

        this.price = price;<o:p></o:p>

        this.pubTime = pubTime;<o:p></o:p>

    }<o:p></o:p>

<o:p> </o:p>

    /**<o:p></o:p>

     * @return the id<o:p></o:p>

     */<o:p></o:p>

    public Long getId() {<o:p></o:p>

        return id;<o:p></o:p>

    }<o:p></o:p>

<o:p> </o:p>

    /**<o:p></o:p>

     * @param id<o:p></o:p>

     *            the id to set<o:p></o:p>

     */<o:p></o:p>

    public void setId(Long id) {<o:p></o:p>

        this.id = id;<o:p></o:p>

    }<o:p></o:p>

<o:p> </o:p>

    /**<o:p></o:p>

     * @return the name<o:p></o:p>

     */<o:p></o:p>

    public String getName() {<o:p></o:p>

        return name;<o:p></o:p>

    }<o:p></o:p>

<o:p> </o:p>

    /**<o:p></o:p>

     * @param name<o:p></o:p>

     *            the name to set<o:p></o:p>

     */<o:p></o:p>

    public void setName(String name) {<o:p></o:p>

        this.name = name;<o:p></o:p>

    }<o:p></o:p>

<o:p> </o:p>

    /**<o:p></o:p>

     * @return the price<o:p></o:p>

     */<o:p></o:p>

    public double getPrice() {<o:p></o:p>

        return price;<o:p></o:p>

    }<o:p></o:p>

<o:p> </o:p>

    /**<o:p></o:p>

     * @param price<o:p></o:p>

     *            the price to set<o:p></o:p>

     */<o:p></o:p>

    public void setPrice(double price) {<o:p></o:p>

        this.price = price;<o:p></o:p>

    }<o:p></o:p>

<o:p> </o:p>

    /**<o:p></o:p>

     * @return the pubTime

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值