View all fields / properties of bean in JSP / JSTL

后端 未结 4 1501
误落风尘
误落风尘 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条回答
  •  一向
    一向 (楼主)
    2020-12-23 10:32

    Replace object with the bean to determine.

    
    

    Display all declared fields and their values.

    
        

    Declared fields ${object.name}

    • ${field.name}: ${object[field.name]}

    Display all declared methods.

    
        

    Declared methods<% object.getName() %>

    • ${method.name}

提交回复
热议问题