I have a problem with a date field. When the form is first loaded the date (loaded from the database) is formatted correctly. When I submit the form (which navigates back to itself) the date is formatted in a different format. If I navigate away to another page and come back, the formatting is correct again. Any ideas? TIA.
My controller overrides the initBind:
My JSP:Code:protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { super.initBinder(request, binder); binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("MM/dd/yyyy"), true)); }
And the date does save correctly -- its just the formatting that is incorrect. Thanks for looking!Code:<spring:bind path="registration.birthDate"> <input type="text" name="${status.expression}" id="birthDate" value="${status.value}" maxlength="10"/> </spring:bind>
-Jon


Reply With Quote