Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-74114 Make Liferay compatible with version 2.0 tests in the Portlet 3.0 TCK
  3. LPS-77798

PortletResponse.addProperty(String, Element) causes self closing script tags to be rendered which is invalid HTML4 syntax

    Details

      Description

      Problem Background

      Section 18.2.1 of the HTML4 Specification titled "The SCRIPT element" states that the <script> start tag and the </script> end tag are both required.

      The Liferay PortletResponseImpl.java class uses an XML Transform in order to create java.lang.String representations of org.w3c.dom.Element instances. Liferay depends on Apache Xalan in order to perform the transform, which is generating a self-closing <script /> tag.

      Although this is a Portlet 2.0 feature, this problem was discovered by the Portlet 3.0 TCK in the following tests:

      • V3HeaderPortletTests_SPEC15_PortletResponse_ApiHeader_addPropertyB1
      • V3HeaderPortletTests_SPEC15_PortletResponse_ApiHeader_addPropertyB2

      Steps to Reproduce

      1. Download and deploy the attached com.liferay.issue.lps77798.portlet.war artifact

      2. Add com.liferay.issue.lps77798.portlet to a portal page

      3. Reload the page

      Expected Results

      The com.liferay.issue.lps77798.portlet indicates "script element was found in the DOM"

      Actual Results

      The com.liferay.issue.lps77798.portlet indicates "script element was NOT found in the DOM"

        Attachments

          Activity

            People

            • Assignee:
              brian.chan Brian Chan
              Reporter:
              neil.griffin Neil Griffin
              Recent user:
              Csaba Turcsan
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 41 weeks, 2 days ago

                Packages

                Version Package
                7.0.0 DXP FP40
                7.0.0 DXP SP7
                7.0.5 CE GA6
                7.0.X
                Master