With facelets, what's the equivalent of fmt: formatDate?

I am converting a JSP web page to a facelets view handler.

What's the equivalent of fmt: formatDate, etc.?

I know it is not supported. But is there any alternative? Third level implementation?

+1


source to share


2 answers


Usually in JSF you add to the control ( convertDateTime ):

<h:outputText value="#{dateConverterBean.now}">
    <f:convertDateTime type="date" dateStyle="short" />
</h:outputText>

      



The documentation for Facelets assumes they use the same thing.

+3


source


The f: convertDateTime converter uses GMT / UMT as timezone for date / time formatting. This is quite annoying and can lead to incorrect local date and time. You can specify the timezone for the converter using a bean. I would suggest creating your own converter. Executes only a few lines of code and provides more accurate formatting.



+1


source







All Articles