View all fields / properties of bean in JSP / JSTL
问题 I have a bean, ${product} . I would like to view all of the available fields / properties of this bean. So for instance, ${product.price} , ${product.name} , ${product.attributes.colour} etc. Is it possible to dynamically print out all names and values of these properties in JSP, using JSTL/EL? Something like: <c:forEach items="${product}" var="p"> ${p.key} - ${p.value} </c:forEach> 回答1: Replace object with the bean to determine. <c:set var="object" value="${product}" /> Display all declared