David Richard

Greenhorn
+ Follow
since Nov 07, 2011
David likes ...
Firefox Browser Java Linux
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by David Richard

I did like to join the recent discussion on excluding scriptlets from JSP for alternate ways -
I do agree with the trouble with code readability and maintenance on using java code in JSP.
1) But I am thinking which of the approaches has better performance - though including every thing in one JSP file has the issue above mentioned - is not it faster at performance than a layer code which has to go through various classes to get the same job done.
2) also i found few constraints where alternate way like the JSTL tag libraries or Struts libraries are still not well versatile to meet every real world requirement -
ex: i did not find a way to iterate a collection of collection in either JSTL (c:foreach) or Struts(logic:iterate) libraries recursively. Both c:foreach and logic:iterate can extract values in list but not from a list of list.
Any though you would like to put on this problem with out using srciplets.

--David Rich ------
our program has a object which hold a list of list.
*********existing code *******************

class Row
{
list<string> dataColumn;
}


class Table
{
list<row> dataRow;
}

------------ so to reach the dataColumn value in spring jsp, I have to iterate twice using foreach loop ------- something like
<c:foreach items="${model.table}" var="row" />
<tr>
<c:foreach items="${row}" var="column" />
<td><c:out value="${column}" /></td>
</c:forEach
</tr>
</c:forEach

--------------the problem --- spring is not allowing the innner foreach loop --------------

the work around's like... changing the Row class to somthing as below are tedious as the number of column are dynamic ----
class Row
{
string dataColumn1;
string dataColumn2;
string dataColumn3;
}

--------------------------------
thanks for any inputs...

-------------
is there any way i can output my data in jsp with out changing my Row class.
12 years ago