Convert JSF calendar date into JodaTime in Converter

懵懂的女人 提交于 2019-12-05 16:37:52
BalusC

Just stick to java.util.Date in the model, view and persistence layer (as all have already builtin support for it and you generally don't need to perform date calculations/manipulations at those layers at all) and use JodaTime in business layer only whenever you need to perform calculations/manipulations based on the java.util.Date value. This will keep a lot of things simple.

Once you're on Java 8, migrate java.util.Date to java.time.Local/ZonedDateTime. JSF 2.3 will ship with additional Java 8 support in <f:convertDateTime>. Until then, you'll need to homebrew them as instructed in this answer: How to use java.time.ZonedDateTime / LocalDateTime in p:calendar.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!