• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is this the best way to format dates in Spring?

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using Spring 3.0. I wanted to take advantage of Spring forms, so I had



where endDate is a java.util.Datefield of my command object. However, I notice that the date is printed out in verbose format, and I would prefer to apply a formatting to it. The only way I have found so far is to abandon Spring forms and go with



I don't like this mixed Spring form/non-Spring form approach and so I wanted to ask if there's something I'm missing or if this is the only way to do it.

Thanks, - Dave
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead, you can take advantage of Spring 3 Field Formatting.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I would never use a proprietary tag when a standard one is available. I have no problem with a "mixed approach" that involves the JSTL.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic