あなたが豊かにjodatime-オブジェクトを有効にするには、カスタムFacesConverterを使用することができます:カレンダー、JDKカレンダーを使用する必要はありません。 コンバータをrich:calendarで指定し、Converterインターフェイスの2つのメソッドを実装するだけです(例:LocalDateを使用)。
JSFワット/ RichFacesの4.2
<rich:calendar value="#{myObject.myLocalDate}" datePattern="dd.MM.yyyy" converter="localDateConverter"/>
あなたのコンバータクラス:
@FacesConverter(value = "localDateConverter")
public class LocalDateConverter implements Converter {
public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String localDateInTextFormat) {
return DateTimeFormat.forPattern("dd.MM.yyyy").parseLocalDate(localDateInTextFormat);
}
public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object localDate) {
return DateTimeFormat.forPattern("dd.MM.yyyy").print((LocalDate)localDate);
}
}