Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Fix Priority:
      5
    • Similar Issues:
      Show 5 results 

      Description

      While request.getContextPath() is being used correctly, it does not take into account Proxy paths, such as portal.proxy.path=

      This will mostly affect plugins because they will not be properly rendered when accessing Liferay via proxy.

      One example is the chat portlet view.jsp:

       <liferay-util:html-top>
        <link href="<%= PortalUtil.getStaticResourceURL(request, request.getContextPath() + "/css/main.css", portlet.getTimestamp()) %>" rel="stylesheet" type="text/css" />
       </liferay-util:html-top>
      
       <liferay-util:html-bottom>
        <script defer="defer" src="<%= PortalUtil.getStaticResourceURL(request, request.getContextPath() + "/js/main.js", portlet.getTimestamp()) %>" type="text/javascript"></script>
       </liferay-util:html-bottom>
      

      The URL's don't take the proxy path into account.

        Activity

        Hide
        Mika Koivisto added a comment -

        The issue is most clearly reproduced with chat portlet as it doesn't render properly when accessed through proxy. The issue also affects jsonws, webdav and bunch of other plugin portlets.

        Test configuration

        portal-ext.properties

        portal.proxy.path=/portal

        Apache proxy rules:

        ProxyPass /portal ajp://localhost:8009
        ProxyPassReverse /portal ajp://localhost:8009

        Reproduce with chat portlet
        1. Access portal through http://localhost/portal
        2. Sign in

        You should see now chat portlet isn't rendered propertly

        Reproduce with jsonws
        1. Access portal through http://localhost/portal
        2. Sign in
        3. Open http://localhost/portal/c/portal/api/jsonws
        4. Select marketplace portlet context

        Expected result: You see methods available in marketplace portlet. Actual: You are redirected to home

        Show
        Mika Koivisto added a comment - The issue is most clearly reproduced with chat portlet as it doesn't render properly when accessed through proxy. The issue also affects jsonws, webdav and bunch of other plugin portlets. Test configuration portal-ext.properties portal.proxy.path=/portal Apache proxy rules: ProxyPass /portal ajp://localhost:8009 ProxyPassReverse /portal ajp://localhost:8009 Reproduce with chat portlet 1. Access portal through http://localhost/portal 2. Sign in You should see now chat portlet isn't rendered propertly Reproduce with jsonws 1. Access portal through http://localhost/portal 2. Sign in 3. Open http://localhost/portal/c/portal/api/jsonws 4. Select marketplace portlet context Expected result: You see methods available in marketplace portlet. Actual: You are redirected to home
        Hide
        Romain Gonord added a comment -

        Still experiencing this problem with "liferay-portal-6.2-ee-sp4".
        Each way to access the url context doesn't retrieve the proxy path defined in portal-ext :

        <%=request.getContextPath()%>
        ${pageContext.servletContext.contextPath}
        
        Show
        Romain Gonord added a comment - Still experiencing this problem with "liferay-portal-6.2-ee-sp4". Each way to access the url context doesn't retrieve the proxy path defined in portal-ext : <%=request.getContextPath()%> ${pageContext.servletContext.contextPath}

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              10 weeks, 5 days ago

              Development

                Structure Helper Panel