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

ArrayIndexOutOfBoundsException in HstContainerURLProviderImpl when html contains a link like '/site/#'.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Top
    • Resolution: Fixed
    • 2.26.00, 2.26.01
    • 2.26.02
    • None
    • None

    Description

      If a html content node contains a like like 'href="/site/#"' for some reason, it throws ArrayIndexOutOfBoundsException in HstContainerURLProviderImpl:

      [WARNING] [talledLocalContainer] SEVERE: Servlet.service() for servlet jsp threw exception
      [WARNING] [talledLocalContainer] java.lang.ArrayIndexOutOfBoundsException: 0
      [WARNING] [talledLocalContainer] at org.hippoecm.hst.core.container.HstContainerURLProviderImpl.buildHstURLPath(HstContainerURLProviderImpl.java:378)
      [WARNING] [talledLocalContainer] at org.hippoecm.hst.core.container.HstContainerURLProviderImpl.toURLString(HstContainerURLProviderImpl.java:590)
      [WARNING] [talledLocalContainer] at org.hippoecm.hst.core.component.HstURLImpl.toString(HstURLImpl.java:110)
      [WARNING] [talledLocalContainer] at org.hippoecm.hst.core.linking.HstLinkImpl.toUrlForm(HstLinkImpl.java:145)
      [WARNING] [talledLocalContainer] at org.hippoecm.hst.content.rewriter.impl.SimpleContentRewriter.rewrite(SimpleContentRewriter.java:132)
      [WARNING] [talledLocalContainer] at org.hippoecm.hst.content.rewriter.impl.SimpleContentRewriter.rewrite(SimpleContentRewriter.java:67)
      [WARNING] [talledLocalContainer] at org.hippoecm.hst.content.rewriter.impl.SimpleContentRewriter.rewrite(SimpleContentRewriter.java:41)
      [WARNING] [talledLocalContainer] at org.hippoecm.hst.tag.HstHtmlTag.doEndTag(HstHtmlTag.java:112)
      [WARNING] [talledLocalContainer] at org.apache.jsp.WEB_002dINF.jsp.standard.header.alertmessage_jsp._jspx_meth_hst_005fhtml_005f0(alertmessage_jsp.java:122)
      ...

      The exception happens in the following lines:

      String[] hashParts = HASH_PATTERN.split(path);
      // check if preceded with query
      if (hashParts[0].indexOf('?') != -1) {

      In case of '/site/#', the path variable is '#', and the #split() method returns an zero-sized array.

      Attachments

        Issue Links

          Activity

            People

              aschrijvers Ard Schrijvers
              wko Woonsan Ko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: