Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-2844

Refactor PortalTagRenderer to use JspFactory.getPageContext() instead of PageContextStringImpl

    Details

      Description

      {markdown}
      This task involves removing `PageContextStringImpl` from `PortalTagRenderer` and using [JspFactory.getPageContext()](https://tomcat.apache.org/tomcat-4.0-doc/servletapi/javax/servlet/jsp/JspFactory.html#getPageContext(javax.servlet.Servlet,%20javax.servlet.ServletRequest,%20javax.servlet.ServletResponse,%20java.lang.String,%20boolean,%20int,%20boolean)) to create the [PageContext](http://docs.oracle.com/javaee/6/api/javax/servlet/jsp/PageContext.html) object instead. A simple `PageContext` returned from `JspFactory.getPageContext()` can be used instead by calling `PageContext.pushBody(stringWriter)`. Then a tag's string output can be obtained by calling `stringWriter.toString()`. This will greatly reduce the amount of code needed to add elements to the head section.

      This change should be tested in all app servers on 6.2 and 7.0.

      Here is an example of what `PortalTagRenderer` might look like after this change: https://github.com/stiemannkj1/liferay-faces-portal/blob/62168d650c9fe97f0dd3391f48bfcdf352e738c0/portal/src/main/java/com/liferay/faces/portal/render/internal/PortalTagRenderer.java#L192-L260

      *Note:* [JSPSupportServlet](https://github.com/liferay/liferay-portal/blob/50888548989ba65c75f7cb7c9c90fa1957cd2117/portal-kernel/src/com/liferay/portal/kernel/servlet/JSPSupportServlet.java) does not exist in Liferay 6.2 so it must be copied into Bridge Ext for Liferay 6.2 branches.{markdown}

        Attachments

          Activity

            People

            Assignee:
            neil.griffin Neil Griffin
            Reporter:
            kyle.stiemann Kyle Stiemann (Inactive)
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                portal-1.0.1
                portal-2.0.1
                portal-3.0.1