Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calendar in JSTL  RSS feed

 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
As Date is deprecated, I am using Calendar for one of the data fields. I want to display the Calendar in JSP using JSTL format function. I tried to do this, but it is giving error.

<fmt:formatDate value="${calendarObj}" type="calendar" pattern="MM/dd/yyyy"/>

Error is:
Attempt to coerce a value of type "java.util.GregorianCalendar" to type "java.util.Date"'

Any help is appreciated.

Thanks
Sudha
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sudha swami wrote:As Date is deprecated ...

java.util.Date is not deprecated.

Many of its older constructors and methods are, but Date itself is alive and well and you should feel free to use it.
 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear,
thank you for the information.
Sudha
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!