With JSF, Managed Beans, and EL 2.2 I usually know that a form expression:
The corresponding set of functions in the managed bean class is displayed as follows:
@ManagedBean
class Bean {
private String value;
public String getValue() { return value; }
public void setValue( String s ) { value = s; }
}
You can also get and set display properties:
#{bean.value['key']}
Based on something like:
@ManagedBean
class Bean {
private Map<String, Boolean> kvMap;
public boolean getValue( String key ) { return kvMap.get( key ); }
public void setValue( String key, boolean value ) { kvMap.put( key, value ); }
}
So far so good.
I find how I spend more time with JSF, however, that I am trying to write reusable snippets of code. In particular, small xhtml blocks in <ui:composition>blocks that I can include through <ui:include>. What's more, many of the most useful things for me are things like nested sets of checkboxes (our user interface designer just spins over them ;-), and it <ui:repeat>becomes very convenient there.
, <ui:repeat> <ui:include> , , <ui:param> inline - var <ui:repeat>.
UIComponents, , , , JSF (- ).
, , :
- JSF , , ? JSF , getter-only (, ), , , , , , , .
, - , , FacesContext... , , . , , , , , .
, , , .