-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.0.6 GA
-
Fix Version/s: --Sprint 11/12, 6.2.0 CE M2
-
Component/s: Site Templates
-
Labels:
-
Environment:Mac or Windows deployment, running on Tomcat 6.0.29 and Java 1.6
-
Fix Priority:3
If the cdn.host.http or cdn.host.https properties are defined in portal-ext.properties, the provided host is used or all URLs pointing to the html/js directory. This includes JSP files such as barebone.jsp.
Digging into the source code shows that the CDN Host is prepended onto all Javascript file paths in ServicePreAction.java by the following line:
themeDisplay.setPathJavaScript(cdnHost.concat(contextPath).concat("/html/js"));
A call to getPathJavaScript is then made within the ThemeDisplay's getPathJavaScript() method. A call ThemeDisplay.getPathJavaScript() is in turn made within the top_js.jspf file, where we have:
<c:choose>
<c:when test="<%= themeDisplay.isThemeJsBarebone() %>">
<script src="<%= HtmlUtil.escape(PortalUtil.getStaticResourceURL(request, themeDisplay.getPathJavaScript() + "/barebone.jsp", "minifierBundleId=" + HttpUtil.encodeURL("javascript.barebone.files"), javaScriptLastModified)) %>" type="text/javascript"></script>
</c:when>
<c:otherwise>
<script src="<%= HtmlUtil.escape(PortalUtil.getStaticResourceURL(request, themeDisplay.getPathJavaScript() + "/everything.jsp", "minifierBundleId=" + HttpUtil.encodeURL("javascript.everything.files"), javaScriptLastModified)) %>" type="text/javascript"></script>
</c:otherwise>
</c:choose>
The logic for this needs to be fixed, as there is no sense in putting JSP files on a CDN.
There is a similar issue with the loading of css.jsp. I'm creating a separate ticket for that issue, since the files involved and root cause are slightly different. Given that I found other tickets relating to CDN issues and JSP files before filing this, it might be necessary to expand the scope of these tickets to a deeper investigation of CDN-related code.
- is related to
-
LPS-24090 top_head.jsp references CDN Host when loading css.jsp
- Closed