|
How to get an ArrayList Object in servlet from JSP?
|
Posted: Jun 10, 2005 12:02 AM
|
|
Advertisement
|
hi all
please give the solution for this without using session and application...
In test1.jsp file i am setting values for my setter methods using <jsp:usebean> <jsp:setproperty> tags as shown below.
After that i am adding the usebean object to array list, then using request.setAttribute("arraylist object")
---------Code---------- <jsp:useBean id="payment" class="com.common.PaymentHandler" scope="request" />
<jsp:setProperty name="payment" property="strCreditCardNo" param="creditCardNumber" /> <%-- <jsp:setProperty name="payment" property="iCsc" param="securityCode" /> --%> <jsp:setProperty name="payment" property="strDate" param="expirationDate" /> <jsp:setProperty name="payment" property="strCardType" param="creditCardType" /> <%--<jsp:setProperty name="payment" property="cDeactivate" param="deactivateBox" /> <jsp:setProperty name="payment" property="fAmount" param="depositAmt" /> <jsp:setProperty name="payment" property="fAmount" param="totalAmtDue" /> --%>
<jsp:useBean id="lis" class="java.util.ArrayList" scope="request"> <% lis.add(payment); %>
</jsp:useBean>
<% request.setAttribute("lis 1",lis); %> -----------Code in JSP-----------------
In testServlet.java
i tried to get the arraylist object in servlet using request.getAttribute
But I unable to get that arrayObject in servlet.....
So if any one help me out in this, it will be very helpfull to me..
Thanks in Advance
Edward
|
|