Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4864

'format' not set in ConversionException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.2.0
    • Fix Version/s: 6.3.0
    • Component/s: wicket-datetime
    • Labels:
      None

      Description

      There are two DateConverter implementations in wicket:
      [1] wicket.util.convert.DateConverter
      [2] wicket.datetime.DateConverter

      When an error occures while converting the input, both throw a ConversionException. This ConversionException has a property called 'format' which is later used to get a localized pattern for error messages. But since they base on different formatter classes (jdk/joda-time), the formatter of [2] is incompatible to the format property.

      So I can see 2 ways of solving this issue:
      1. put an already localized pattern as a variable (also named 'format') in ConversionException (using ConversionException .setVariable() - those variables are later also applied to the error message)
      2. Alter the class ConversionException so its property 'format' holds the localized pattern as a string, instead of an instance of SimpleDateFormat

        Attachments

        1. DateConverter.patch
          1 kB
          Benedikt Schlegel

          Activity

            People

            • Assignee:
              mgrigorov Martin Grigorov
              Reporter:
              codecab Benedikt Schlegel
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: