• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Calendar in JSTL

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear,
thank you for the information.
Sudha
reply
    Bookmark Topic Watch Topic
  • New Topic