<%-- replace object with var to test --%>
<c:set var="object" value="${product}" />
<c:if test="${!empty object.class.declaredFields}">
<h2>Object Attributes <em>${object.name}</em></h2>
<ul>
<c:forEach var="attr" items="${object.class.declaredFields}">
<c:catch><li><span>${attr.name}</span>${object[attr.name]}</li></c:catch>
</c:forEach>
</ul>
</c:if>
<c:if test="${!empty object.class.declaredMethods}">
<h2>Object Methods<em><% object.getName() %></em></h2>
<ul>
<c:forEach var="attr" items="${object.class.declaredMethods}">
<c:catch><li>${attr.name}</li></c:catch>
</c:forEach>
</ul>
</c:if>
Last active
May 17, 2024 03:37
-
-
Save mauricecruz/4817190fafde15514578 to your computer and use it in GitHub Desktop.
Useful Snippets
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment