Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in logic:iterate

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

this is my jsp
________________________________________________________
<logic:iterate id="emp1" name="encash_trans">

<tr align="left">
<td ><bean:write name="emp1" property="appliedDays"/></td>
<td ><bean:write name="emp1" property="encashDate"/></td>
<td ><bean:write name="emp1" property="amountPaid"/></td>
</tr>
</logic:iterate>
________________________________________________________________

my DTO class called Employee
___________________________________-

class Employee{
//variable declaration

public String getAppliedDays(){
return appliedDays;
}
public String getEncashDate(){
return encashDate;
}
public String getAmountPaid(){
return amountPaid;
}
//here my setter method
}

____________________________________

this is my Action class
___________________________________

ArrayList emp1=EmployeeDAO.getEncashStatement(employee,getDataSource(request));
request.setAttribute("encash_trans",emp1);
______________________________________


my DAO class(return type ArrayList)

_______________________________________
while(rs.next()) {
employee.setAppliedDays("applieddays");
employee.setEncashDate("date");
employee.setAmountPaid("amountpaid");
statement_list.add(employee);
}

_____________________________

now, when i try to use logic:iterate for looping..in my jsp

i did not get the output...what value i have to give in property attribute of writ:bean...

please anyone can explain me...

thanks & regards,
seetharaman
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your iterate tag is fine.First print ArrayList emp1 on console and check data is stored in Arraylist or not.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Naik ..

thanks for reply.. you are right..i did some mistake in DAO class..(i did not put rs.getString(),i put DataBase column name )

sorry!!!

thanks and regards,
setharaman
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic