GeeCON Prague 2014*
The moose likes Struts and the fly likes problem in logic:iterate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in logic:iterate" Watch "problem in logic:iterate" New topic
Author

problem in logic:iterate

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Feb 07, 2005
Posts: 643
Your iterate tag is fine.First print ArrayList emp1 on console and check data is stored in Arraylist or not.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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
 
GeeCON Prague 2014
 
subject: problem in logic:iterate