Results 1 to 2 of 2

Thread: error messages i18n

  1. #1

    Default error messages i18n

    hello,

    my problem i don't know how bind error message in other lenguage.

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

    thanks,
    César.

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    Try
    Code:
    typeMismatch.dateIni=formato fecha incorrecto
    The catch all should be:
    Code:
    typeMismatch.java.util.Date=formato fecha incorrecto

Similar Threads

  1. i18n and database code tables
    By scott_swiftradius in forum Web
    Replies: 0
    Last Post: Jun 21st, 2005, 07:36 AM
  2. Internationalization (i18n)
    By Xtreme in forum Swing
    Replies: 0
    Last Post: May 30th, 2005, 11:06 AM
  3. Replies: 3
    Last Post: May 16th, 2005, 11:14 PM
  4. basic i18n
    By bernardsirius in forum Web
    Replies: 1
    Last Post: Feb 8th, 2005, 07:25 AM
  5. Replies: 1
    Last Post: Sep 24th, 2004, 09:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •