473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Retrieving arraylist data in jsp page.

283 100+
Hi friends,
In my class i have a ArrayList where i have stored the resultset data from the and also a float value i.e ive 2 arraylist. The way ive set the data is--
Expand|Select|Wrap|Line Numbers
  1.  list.add(getData(resultset));
  2. and set it in request
  3. httpservletrequest.setAttribute("list", list);
  4.  
  5. and
  6. Double double1 = new Double(s7);
  7.                String f = double1.floatValue();
  8. list1.add(f);
  9. httpservletrequest.setAttribute("list1", list1);
  10.  
all i want is to retrieve the data from the 2 arraylist in my jsp page.
In my jsp page ive done something like this...
[HTML]
<%
SelCloseReqForm scrobj=null;
ArrayList list=(ArrayList)request.getAttribute("list");

for(Iterator itr=list.iterator();itr.hasNext();)
{
scrobj=(SelCloseReqForm)itr.next();{
%>

<%ArrayList list1=(ArrayList) request.getAttribute("list1");
for(int i=0; i<list1.size(); i++){
Float d=(Float)list1.get(i);
%>
<option value="" <%=scrobj.getReq_Code() %> "," <%=d %> "\"> <%=scrobj.getReq_Code() %> Balance : <%=d %> </option>
<%
}
%>
<%}} %>
[/HTML]
the output that im getting here is...
R1024165 Balance: 823.0
R1024165 Balance: 625.0
R1024165 Balance 367.0
R1024165 Balance 134.0
R1024165 Balance 569.0
R1024165 Balance 289.0
R1024165 Balance 513.0

and again

R2084134 Balance: 823.0
R2084134 Balance: 625.0
R2084134 Balance: 367.0
R2084134 Balance: 134.0
R2084134 Balance: 569.0
R2084134 Balance: 289.0
R2084134 Balance: 513.0

how i want it to be displayed is ...

R1024165 Balance:823.0
R2084134 Balance:625.0
R3054236 Balance: 367.0
R4984267 Balance: 134.0
R5284879 Balance: 569.0
R6904235 Balance: 289.0
R7394198 Balance: 513.0
and so on...
How can i achieve this...ive been trying this for couple of days now...im stuck because of this...please help me :)
regards,
ajos
Dec 7 '07 #1
1 9318
ajos
283 100+
Hi friends,
Never mind guys, i found out the solution, Thanks for reading anyways
regards,
ajos
Dec 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: melanieab | last post by:
Hi, I can't seem to get the syntax correct. I have an xmlnodelist full of elements called "file". Each file has an attribute called "ID". If I just want to get, say, the ID of the second file...
2
by: Alan Lambert | last post by:
If have an asp.net page (code behind written in VB.NET) which needs to store information from a postback in an arraylist and retain this list across multiple postbacks. The variable is declared...
7
by: Dave | last post by:
Hi all, I have... using System.Collections; namespace MyApp.Templates { public class MyPage : System.Web.UI.Page { ArrayList MyArray = new ArrayList();
1
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry =...
2
by: RSH | last post by:
I am struggling a bit trying to get at all of the Table names in a given Access database. I have the code below which should be retrieving the information...i am just having a bit of trouble...
6
by: AlveenX | last post by:
Hi, I am trying to pick a Guid from a data row using the following code: foreach(DataRow row in MyDataTable.Rows) { (Guid)row }
4
by: Giggi | last post by:
Hi! I have a little problem... I have 3 pages: users should go from page1 to page2 and then to page3 In page1 there is an arraylist, and I can access it from page2 using the PreviousPageType...
3
by: ajos | last post by:
Hello friends, In my action class i am getting a resultset data which im storing in a arraylist. In my jsp page im retrieving the arraylist data as-----> <%publicity.PendingReqForm prfObj=null;...
9
by: ajos | last post by:
Hello friends, After thinking about this for sometime, i decided to post this in the java forum. Well my problem here in detail is, i have 3 jsp pages where in a.jsp(for example) i have a combo...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.