I am currently learning Sturts/JSP.
Could someone help me by posting a piece of code to display JSP/HTML data in Struts as below.
I have a form bean and databean. I was able to use the Sturts logic tld to display the data.
The problem i am facing was , all the records were displayed ,But i need to display one column attribute once and rest of columns in a grid.
Basically i need the manager name to be displayed only once in one tab and the rest of the data in a grid.
How do i achieve this in JSP/HTML when the data is in List.
++++++++++++++++++++++++++++++++++++++++++++++++++++++
Manager Name SCOTT
Employee No Employee Name Dept No Dept Name
1234 JIM 10 HR
2345 MIKE 20 AO
2341 ROGER 10 HR
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
<HTML>
<TABLE id=content-margins width="98%">
<TBODY>
<TR>
<TD colspan="2"><table id=content-margins width="98%">
<tr>
<td colspan="4"><p><strong>Manager Data </strong></p>
<logicresent name="TestForm">
<logicresent name="TestForm" property="results">
<logic:equal name="TestForm" property="results.empty" value="false">
<% System.out.println("In jsp/html 1"); %>
<table id=FormattedTable width="75%">
<tbody>
<tr class=head3>
<TH class=data-center>Manager Name</TH>
<TH class=data-center>Employee No</TH>
<TH class=data-center>Employee Name</TH>
<TH class=data-center>Dept No</TH>
<TH class=data-center>Dept Name</TH>
</tr>
<% System.out.println("In jsp/html 2"); %>
<logic:iterate id="EMPD" type="com.man.dev.action.empData"
name="TestForm" property="results">
<% System.out.println("In jsp/html 3"); %>
<tr>
<td><bean:write name="EMPD" property="managername"/></td>
<td><bean:write name="EMPD" property="empno"/></td>
<td><bean:write name="EMPD" property="empname"/></td>
<td><bean:write name="EMPD" property="deptno"/></td>
<td><bean:write name="EMPD" property="deptname"/></td>
</tr>
</logic:iterate>
</tbody>
</table>
</logicresent>
</logicresent>
</td>
</tr>
</TD
</TR>
</TABLE>
</BODY>
</HTML>
Thanks
Jim
Could someone help me by posting a piece of code to display JSP/HTML data in Struts as below.
I have a form bean and databean. I was able to use the Sturts logic tld to display the data.
The problem i am facing was , all the records were displayed ,But i need to display one column attribute once and rest of columns in a grid.
Basically i need the manager name to be displayed only once in one tab and the rest of the data in a grid.
How do i achieve this in JSP/HTML when the data is in List.
++++++++++++++++++++++++++++++++++++++++++++++++++++++
Manager Name SCOTT
Employee No Employee Name Dept No Dept Name
1234 JIM 10 HR
2345 MIKE 20 AO
2341 ROGER 10 HR
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
<HTML>
<TABLE id=content-margins width="98%">
<TBODY>
<TR>
<TD colspan="2"><table id=content-margins width="98%">
<tr>
<td colspan="4"><p><strong>Manager Data </strong></p>
<logicresent name="TestForm">
<logicresent name="TestForm" property="results">
<logic:equal name="TestForm" property="results.empty" value="false">
<% System.out.println("In jsp/html 1"); %>
<table id=FormattedTable width="75%">
<tbody>
<tr class=head3>
<TH class=data-center>Manager Name</TH>
<TH class=data-center>Employee No</TH>
<TH class=data-center>Employee Name</TH>
<TH class=data-center>Dept No</TH>
<TH class=data-center>Dept Name</TH>
</tr>
<% System.out.println("In jsp/html 2"); %>
<logic:iterate id="EMPD" type="com.man.dev.action.empData"
name="TestForm" property="results">
<% System.out.println("In jsp/html 3"); %>
<tr>
<td><bean:write name="EMPD" property="managername"/></td>
<td><bean:write name="EMPD" property="empno"/></td>
<td><bean:write name="EMPD" property="empname"/></td>
<td><bean:write name="EMPD" property="deptno"/></td>
<td><bean:write name="EMPD" property="deptname"/></td>
</tr>
</logic:iterate>
</tbody>
</table>
</logicresent>
</logicresent>
</td>
</tr>
</TD
</TR>
</TABLE>
</BODY>
</HTML>
Thanks
Jim