I have a Tiles Definition that uses many child
JSP files doing the same thing, which is listing elements in their respective Collection.
For the 1st child JSP, it contains code like:
<%
Collection c = (Collection)request.getAttribute("localElements");
%>
The 2nd child contains:
<%
Collection c = (Collection)request.getAttribute("domesticElements");
%>
Other children get other collection with different attributes. All the children have the same code of displaying all the elements in the Collection by iteration.
It doesn't take an Einstein to know that this is not good. A lot of duplicate codes in different JSPs exist just because each child JSPs need to iterate different collections.
Any advice of how I could extract the common codes such that there will be no duplication in the JSPs?
[ February 25, 2005: Message edited by: Ken Loh ]
[ February 25, 2005: Message edited by: Ken Loh ]