The course English 217 definitely is a tough one. Eight books need to be read through this short summer. How can i finish it?
Continue to talk about JSF here:
Converter is very important when the data transfers from the front page to the back-end java beans. For those basic generic data type, such as String, boolean, int, JSF 2.0 provides the conversion automatically. But for Date type, we need to claim one tag <f:convertDateTime> inside the input tag.
Here is the first case, for boolean type:
<div class="controls">
<h:selectOneRadio value="#{tmpBean.federalOs}">
<f:selectItem itemValue="true" itemLabel="Yes" />
<f:selectItem itemValue="false" itemLabel="No" />
</h:selectOneRadio>
</div>
The point needs to be mentioned here is for boolean, only two values "true" or "false" are acceptable, other values such as "Y" or "N" can not be considered as proper boolean values. This kind of setting is reasonable since it follows the rules
in Java AND won't mess up something. Therefore, in your application, if you want to set one parameter value (to you, it's boolean) to be "Y" or "N", you probably need to set it to be String type.
Another case if for Date type:
<h:inputText class="span2" value="#{tmpBean.letDate}">
<f:convertDateTime pattern="MM/dd/yyyy"/>
</h:inputText>
The tag is very clear here.
The java beans for above two parameter are:
// Bean name: tmpBean
//...
private boolean federalOs;
//...
private Date letDate