Monday, October 21, 2013

Accessing bean's property dynamically like a map

Assuming we have the following class
public class MyBean {
    private String property1;
    private String property2;

    // getter and setting for property1, property2, ...

Normally we are accessing the properties in a bean from xhtml like syntax below.

But, recently found that we can actually accessing the properties of a bean like accessing a map.


in normally circumstances, it is nothing special from the traditional way.
But it is relatively useful if we want to dynamically access the properties in a bean.


No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...