Given a class A:
public class A {
private String foo;
//getter, setters etc...
}
can one reference the foo property if an A object itself is exposed as property in a managed bean, e.g:
@ManagedBean
public class SomeBean {
private A a;
//getter, setters etc...
}
#{someBean.a.foo}
Indeed, it will work. Both for setting and obtaining the value. An input such as:
will both obtain the value to display it and set the new defined value by doing either
or
Just take into account that for this to work and avoid getting a
NullPointerException,getA()cannot returnnull, meaning that youraobject must be instantiated.