DateTime « MVC « Spring Q&A

1. How to display a formatted DateTime in Spring MVC 3.0?

I have a Joda-DateTime field in my model and want to display it formatted in a JSP view. I have annotated it with the new @DateTimeFormat annotation:

public class Customer {

2. @DateTimeFormat in Spring produces off-by-one day error

I am currently using @DateTimeFormat in a domain object as follows:

@DateTimeFormat(pattern = "MM/dd/yyyy")
private Date startDate = new Date();
In a Spring MVC Controller, I am posting today's date: 10/19/2011 using the jQuery ...

3. problem with web mvc dateTime field and disabled