The Artima Developer Community
Sponsored Link

Java Answers Forum
How to get an ArrayList Object in servlet from JSP?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Edward Mahimairaj S

Posts: 1
Nickname: eddie12375
Registered: Jun, 2005

How to get an ArrayList Object in servlet from JSP? Posted: Jun 10, 2005 12:02 AM
Reply to this message Reply
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

Topic: I need help on Sending automatic emails wihtout user intervention using jav Previous Topic   Next Topic Topic: I want know the Main Disadvantages using Inheritance

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use