问题
GWT 2.6 is not serializing Java Date properly.When i Enter the Date 17.10.1983 it shows 16.10.1983 and if I enter 16.10.1983 it shows 15.10.1983.How can i solve it?
回答1:
It may be the locale/timezone issue. You can solve it by passing value as long (time in milliseconds) or string (date as string). Just form the date object back at the server side.
My another post might help you Setting locales in gwt.xml do not work
How you can form the the date object back at server side based on client locale?
Sample code:
Locale locale = httpRequest.getLocale(); // Get the client browser locale
SimpleDateFormat formatter = (SimpleDateFormat) DateFormat.getDateTimeInstance(
DateFormat.SHORT, DateFormat.MEDIUM, locale);
来源:https://stackoverflow.com/questions/23824835/why-date-is-not-serializing-in-gwt-2-6