HI..
I m creating a Jsp custom tag, that should take an array object in the custom tag and it should display the elements of the tag in the HTML table form. Do anyone have the suggestion kindly helpful.
Thanks and regards. Vinayak
HI..
I m creating a Jsp custom tag, that should take an array object in the custom tag and it should display the elements of the tag in the HTML table form. Do anyone have the suggestion kindly helpful.
Thanks and regards. Vinayak
Do you mean something like displayTag? That can form tables out of lists of objects.
As Phill mentioned, the Display Tag taglib is very good for this, but it's actually really easy to do using JSTL:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
.
.
.
<table summary="">
<thead>
<tr>
<th>Property 1</th>
<th>Property 2</th>
</tr>
</thead>
<tbody>
<c:forEach var="item" items="${someArrayObject}">
<tr>
<td><c:out value="${item.property1}" /></td>
<td><c:out value="${item.property2}" /></td>
</tr>
</c:forEach>
</tbody>
</table>
Depending on your needs, a custom taglib may be overkill.