hello,
my problem i don't know how bind error message in other lenguage.
i have a jsp:
in the form controller:Code:<spring:bind path="command.user.dateIni"> <FONT color="red"> <B><c:out value="${status.errorMessage}"/></B> </FONT> <BR> <INPUT type="text" class="cajamin9" name="<c:out value="${status.expression}"/>" value="<c:out value="${status.value}"/>"> </spring:bind>
when i put a incorrect format date:Code:protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) { SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm"); dateFormat.setLenient(false); binder.registerCustomEditor(Date.class, null, new CustomDateEditor(dateFormat, false)); }
i have a fich messages_es.properties:Code:Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for property 'cita.fechaIni'; nested exception is java.lang.IllegalArgumentException: Could not parse date: Unparseable date: "1510/2004 09:41"
why don't use the message?Code:typeMismatch.date=formato fecha incorrecto typeMismatch.user.dateIni=formato fecha incorrecto
have i to do anything else?
are there a list of error codes like typeMismatch to translate to other lenguage?
thanks,
César.


Reply With Quote