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

    Details

    • Fix Priority:
      3

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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

                  Packages

                  Version Package
                  --Sprint 11/12
                  6.2.0 CE M2