Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are both getters and setters mandatory in JSF's managed beans?

I have a JSF component which is initialized from a managed bean's getter getProperty(). Is it mandatory to also have a setter setProperty() in that managed bean?

like image 592
jj88 Avatar asked Oct 09 '22 21:10

jj88


1 Answers

It depends.

Some property bindings must be read-write. For example, if you bind the value of a component that implements EditableValueHolder. Other properties can be read-only.

If you use the binding attribute for dynamically creating component instances, this must also be read-write as per the contract defined in the specification.

like image 129
McDowell Avatar answered Oct 20 '22 12:10

McDowell