Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-24089

Links to JSP files in html/js include CDN host


    • Fix Priority:


      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:


      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: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>
      <script src="<%= HtmlUtil.escape(PortalUtil.getStaticResourceURL(request, themeDisplay.getPathJavaScript() + "/everything.jsp", "minifierBundleId=" + HttpUtil.encodeURL("javascript.everything.files"), javaScriptLastModified)) %>" type="text/javascript"></script>

      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.


          Issue Links



              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created:
                  Days since last comment:
                  8 years, 27 weeks, 5 days ago


                  Version Package
                  --Sprint 11/12
                  6.2.0 CE M2