View all fields / properties of bean in JSP / JSTL

java web project,how to view all fields / properties of bean in JSP / JSTL

详情见链接:点击打开链接


for example: 在jsp里面的body标签里加下面内容:

<c:set var="object" value="${MAP02}" />
    <c:if test="${not empty object['class'].declaredFields}">
   <h2>Declared fields <em>&dollar;{object.name}</em></h2>
   <ul>
       <c:forEach var="field" items="${object['class'].declaredFields}">
           <c:catch><li><span>${field.name}</span>${object[field.name]}</li></c:catch>
       </c:forEach>
   </ul>
</c:if>


猜你喜欢

转载自blog.csdn.net/daocaoren1543169565/article/details/79639639