Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Engine 2.2.8
Description
The <c:url> JSTL tag (org.apache.taglibs.standard.tag.rt.core.UrlTag) does not work with multi domain mappings configured to the same path.
org.apache.taglibs.standard.tag.rt.core.UrlTag uses
org.apache.taglibs.standard.tag.common.core.UrlSupport which calls
response.encodeURL(result); in the doEndTag method. That goes down to
org.apache.sling.engine.impl.SlingHttpServletResponseImpl.encodeUrl(String).
SlingHttpServletResponseImpl.encodeUrl calls SlingHttpServletResponseImpl.map(String) without the request. This can result in wrong mapping if more than one mapping matches always the frist one is picked.
Can be reproduces by using the following mapping confighttp://localhost:4503/etc/map/http.tidy.-1.json):
{
"jcr:primaryType": "sling:Folder",
"host-a1.com":
,
"host-a2.com":
}
When using <c:url> to encode a link a request on host-a1.com works fine. The return value of the tag is a relative link. Access via host-a2.com is broken and <c:url> return a full link pointing to domain hoas-a1.com.
Attachments
Issue Links
- breaks
-
SLING-3504 SlingHttpServletResponseImpl.encodeXXX methods always add context path
- Closed