View all fields / properties of bean in JSP / JSTL

后端 未结 4 1499
误落风尘
误落风尘 2020-12-23 09:53

I have a bean, ${product}. I would like to view all of the available fields / properties of this bean. So for instance, ${product.price}, ${p

4条回答
  •  Happy的楠姐
    2020-12-23 10:39

    Ready to use version of @Toby's answer

    Object:  ${object.class}

    Declared fields

    • ${attr.name}:  ${object[attr.name]}
    No declared fields

    Declared methods

    • ${attr.name}(...)
    No declared methods

提交回复
热议问题