如何在动作类中访问jsp arraylist对象

时间:2014-05-01 09:48:27

标签: java jsp arraylist struts2

我正在运行paidList ArrayList我正在迭代它并再次获得适当的值我将此paidList(更新其值)提交到update()并打印输出窗口中的值,它显示的是简单值,但无法显示getPaidList().get(0).getCashActionList()getDDActionList()getOnlineActionList()

的值

的index.jsp

<s:form action="UpdatedPaid" method="post">  
    <s:if test="paidList.size>0"> 
        <s:iterator value="paidList" var="pdlst">
            <div class="box">
                <span class="label">Amount</span>
                <span class="ib"> 
                    <s:hidden name="paidId" id="paidId">
                        <s:param name="value">
                            <s:property value="paidId"/>
                        </s:param>
                    </s:hidden>
                    <s:textfield name="amount" id="amount">
                        <s:param name="value">
                            <s:property value="amount"/>
                        </s:param>
                    </s:textfield>
                </span>
            </div>
            <div class="box">
                <span class="label">Payment Date</span>
                <span class="ib"> <s:textfield name="paymentDate" id="paymentDate">
                        <s:param name="value">
                            <s:property value="paymentDate"/>
                        </s:param>
                    </s:textfield>
                </span>
            </div>
            <s:if test="cashActionList.size>0"> 
                <s:iterator value="cashActionList" var="calst">
                    <div class="box">
                        <span class="label">TO Person</span>
                        <span class="ib">
                            <s:hidden name="id" id="id">
                                <s:param name="value">
                                    <s:property value="id"/>
                                </s:param>
                            </s:hidden>
                            <s:textfield name="toPerson" id="toPerson">
                                <s:param name="value">
                                    <s:property value="toPerson"/>
                                </s:param>
                            </s:textfield>
                        </span>
                    </div>
                </s:iterator>
            </s:if>
            <s:if test="DDActionList.size>0"> 
                <s:iterator value="DDActionList" var="calst">
                </s:iterator>
            </if>
            <s:if test="OnlineActionList.size>0">
                <s:iterator value="OnlineActionList" var="calst">
                </s:iterator>
            </s:if>
        </s:iterator>
    </s:if>
</s:form>

行动类

public class SupplierPaidAction extends ActionSupport {
private long paidId;
private long supplierPaymentId;
private float amount;
private float paidAmount;
private String payment_mode;
private Date paymentDate;
private Timestamp addDate;
private String dataStatus;
private long ccold;
private ArrayList<SupplierPaidAction> paidList;
private ArrayList<CashAction> cashActionList;
private ArrayList<DDAction> DDActionList;
private ArrayList<OnlinePaymentAction> OnlineActionList;
//getter and setter of all fields

 public String update() {
        System.out.println("-> SupplierPaidAction update()");
        System.out.println(getPaidId() + " " + getAmount()
        + " " + getPaymentDate()+" "+getPaidList().get(0).getCashActionList()
            +" "+getDDActionList()+" "+getOnlineActionList());
return SUCCESS;
}


public Timestamp getAddDate() {
        return addDate;
    }

    public void setAddDate(Timestamp addDate) {
        this.addDate = addDate;
    }

    public String getDataStatus() {
        return dataStatus;
    }

    public void setDataStatus(String dataStatus) {
        this.dataStatus = dataStatus;
    }

    public long getSupplierPaymentId() {
        return supplierPaymentId;
    }

    public void setSupplierPaymentId(long supplierPaymentId) {
        this.supplierPaymentId = supplierPaymentId;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public LoginCheck getLc() {
        return lc;
    }

    public void setLc(LoginCheck lc) {
        this.lc = lc;
    }

    public int getP() {
        return p;
    }

    public void setP(int p) {
        this.p = p;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPages() {
        return totalPages;
    }

    public void setTotalPages(int totalPages) {
        this.totalPages = totalPages;
    }

    public ArrayList<SupplierPaidAction> getPaidList() {
        return paidList;
    }

    public void setPaidList(ArrayList<SupplierPaidAction> paidList) {
        this.paidList = paidList;
    }

    public String getStr() {
        return str;
    }

    public void setStr(String str) {
        this.str = str;
    }

    public long getPaidId() {
        return paidId;
    }

    public void setPaidId(long PaidId) {
        this.paidId = PaidId;
    }

    public float getAmount() {
        return amount;
    }

    public void setAmount(float amount) {
        this.amount = amount;
    }

    public Date getPaymentDate() {
        return paymentDate;
    }

    public void setPaymentDate(Date paymentDate) {
        this.paymentDate = paymentDate;
    }

    public String getPayment_mode() {
        return payment_mode;
    }

    public void setPayment_mode(String payment_mode) {
        this.payment_mode = payment_mode;
    }

    public float getPaidAmount() {
        return paidAmount;
    }

    public void setPaidAmount(float paidAmount) {
        this.paidAmount = paidAmount;
    }

    public CashBean getCashBean() {
        return cashBean;
    }

    public void setCashBean(CashBean cashBean) {
        this.cashBean = cashBean;
    }
  public ArrayList<CashAction> getCashActionList() {
        return cashActionList;
    }

    public void setCashActionList(ArrayList<CashAction> cashActionList) {
        this.cashActionList = cashActionList;
    }

    public ArrayList<DDAction> getDDActionList() {
        return DDActionList;
    }

    public void setDDActionList(ArrayList<DDAction> DDActionList) {
        this.DDActionList = DDActionList;
    }

    public ArrayList<OnlinePaymentAction> getOnlineActionList() {
        return OnlineActionList;
    }

    public void setOnlineActionList(ArrayList<OnlinePaymentAction> OnlineActionList) {
        this.OnlineActionList = OnlineActionList;
    }

    public long getCcold() {
        return ccold;
    }

    public void setCcold(long ccold) {
        this.ccold = ccold;
    }
}

如何从jsp获取ArrayList(cashActionListDDActionListOnlineActionList)的值到action

0 个答案:

没有答案