Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-2023

Return type java.util.Date does not work in a ParametersInfo class

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • 2.24.02, 2.25.01-alpha
    • 2.30.00
    • Template Composer
    • None

    Description

      When a ParametersInfo class contains a method with return type java.util.Date, the template composer will render a date picker to select a date. Setting the date in the UI works fine, but retrieving the date in the HstComponent fails. The following exception is then logged:

      [INFO] [talledLocalContainer] 27.01.2012 17:59:09 WARN [org.apache.commons.beanutils.converters.DateTimeConverter.toDate():465] DateConverter does not support default String to 'Date' conversion.
      [INFO] [talledLocalContainer] 27.01.2012 17:59:09 WARN [org.apache.commons.beanutils.converters.DateTimeConverter.toDate():466] (N.B. Re-configure Converter or use alternative implementation)

      Steps to reproduce:
      1. create a project with archetype 1.05.02
      2. add a method that return a date to the ListViewInfo class. For example:

      @Parameter(name = "myDate", defaultValue = "5/5/2012", displayName = "My Date")
      Date getMyDate();

      3. in the ListView component retrieve the date value. For example:

      ListViewInfo info = getParametersInfo(request);
      System.out.println("Date=" + info.getMyDate());

      4. login as admin into the CMS, open the template composer drag the 'list' component into the container on the home page.

      Expected result: no warnings are logged
      Actual result: many warnings are logged about DateTimeConverter.toDate()

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mdenburger Mathijs den Burger (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: