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
- list.add(getData(resultset));
- and set it in request
- httpservletrequest.setAttribute("list", list);
- and
- Double double1 = new Double(s7);
- String f = double1.floatValue();
- list1.add(f);
- httpservletrequest.setAttribute("list1", list1);
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