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

Parameterized component parameter returns IllegalArgumentException if no value is set in a sitemap item

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Low
    • Resolution: Fixed
    • 2.04.06
    • 2.05.01
    • None
    • None
    • Does not occur in the current default HST setup, but if you upgrade Spring to v 3 for some application containers like JBoss you'll run into this problem. Spring 3 was necessary for virtual filesystem support in JBoss 5.

    Description

      In the component config
      hst:parametername pagetype
      hst:parametervalue ${pagetype}

      In the sitemap matcher: no hst:parametername/hst:parametervalue

      In the component class:
      String pagetype = getParameter("pagetype", request);

      getParameter gets an IllegalArgumentException because the underlying classes get ${pagetype} instead of null.

      If you remove the hst:parametername/hst:parametervalue pair from the component config String pagetype is null (which is good).

      Sometimes you want to set the configuration parameter in the component but if no value is passed from the sitemap, you can use some default value (which may be hardcoded in your component class).

      Attachments

        Activity

          People

            aschrijvers Ard Schrijvers
            jasha joachimsthal Jasha Joachimsthal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: