Details
-
Bug
-
Status: Closed
-
Top
-
Resolution: Fixed
-
2.26.00, 2.26.01
-
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
- is a result of
-
HSTTWO-2167 HstLink.toUrlForm URLencodes the # character and request parameters
- Closed