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

WSRP incompatibility with JSF portlets due to empty request parameters getting ignored

    Details

    • Branch Version/s:
      6.1.x, 6.0.x
    • Backported to Branch:
      Committed

      Description

      While working on FACES-1181, I found that WSRP actions that invoked HTTP POST worked well, except when a parameter had an empty value.

      For example, when submitting a form with "firstName" and "dateOfBirth" fields, the SOAP envelope looks like this:

      <resourceParams>
          ...
          <formParameters name="firstName">
           <value></value>
          </formParameters>
          <formParameters name="dateOfBirth">
           <value>04/18/2012</value>
          </formParameters>
      </resourceParams>
      

      But when the portlet is invoked by V2MarkupServiceImpl.getBinaryContent(Http.Options), HttpImpl.processPostMethod(...) filters-out the "firstName" parameter because of the following line of code (which actually occurs twice in the method):

      if (Validator.isNotNull(value)) {
          postMethod.addParameter(entry.getKey(), value);
      }
      

      This is how to fix it in both places:

      if (value != null) {
          postMethod.addParameter(entry.getKey(), value);
      }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  7 years, 22 weeks, 3 days ago

                  Packages

                  Version Package
                  6.0.X EE
                  6.1.20 EE GA2
                  --Sprint 11/12
                  6.2.0 CE M2