ICEfaces
  1. ICEfaces
  2. ICE-11246

ace:fileEntry does not namespace all request parameters in a portlet environment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.2.BETA
    • Fix Version/s: 4.2
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Portlet 3.0 / Mojarra 2.3.0-m10
    • Assignee Priority:
      P1

      Description

      h3. Steps to Reproduce:

      A. Follow steps #1 - #11 in ICE-11241.

      B. Using the browser inspection tools, view the list of network requests

      C. Using the "Choose Files" button, select a file to upload.

      D. Click on the "Add Attachment" button

      E. Examine the "Headers" of the XHR postback (the JSF partial request)

      (/) Expected Results
      Request parameters like "javax.faces.partial.execute", "javax.faces.partial.render", "file-entry-id", and "ice.fileEntry.ajaxResponse" are properly prefixed with the portlet namespace. For example:
      {noformat}
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:f2"

      Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:f2
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:javax.faces.encodedURL"

      /pluto/portal/icefaces-applicant/__pdcom.liferay.faces.demo.icefaces.applicant.portlet.1%21-815993408%7C0;0/__rs0/__clcacheLevelPage/__rv0;_facesViewIdResource:0x3WEB-INF0x3views0x3portletViewMode.xhtml/__rv0;_jsfBridgeAjax:true
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:ice.fileEntry.encodedURL"

      /pluto/portal/icefaces-applicant/__pdcom.liferay.faces.demo.icefaces.applicant.portlet.1%21-815993408%7C0;0/__rs0/__clcacheLevelPage/__rv0;_facesViewIdResource:0x3WEB-INF0x3views0x3portletViewMode.xhtml/__rv0;ice.view:vau7scq2%3A0/__rv0;ice.fileEntry.multipart:true/__rv0;ice.window:4hizkbmr88/__rv0;_jsfBridgeAjax:true
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:file-entry-id"

      fileEntryComp
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:ice.window"

      4hizkbmr88
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:ice.view"

      vau7scq2:0
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:f2:fileEntryComp"; filename="About Downloads.pdf"
      Content-Type: application/pdf


      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:f2:_t46"

      Add Attachment
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:javax.faces.ViewState"

      -8366486400589380942:5984252524555356248
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:javax.faces.ClientWindow"

      4hizkbmr88
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:javax.faces.source"

      Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:f2
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:javax.faces.partial.execute"

      Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:f2
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:javax.faces.partial.render"

      @all
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:javax.faces.partial.ajax"

      true
      ------WebKitFormBoundaryShrweHKzcB8GSFHv
      Content-Disposition: form-data; name="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_1__815993408_0_:ice.fileEntry.ajaxResponse"

      true
      ------WebKitFormBoundaryShrweHKzcB8GSFHv--
      {noformat}

      (x) Actual Results

      Request parameters are *not* prefixed with the portlet namespace, and the file does not upload.
      1. fileEntry.js.patch
        3 kB
        Neil Griffin
      2. FileEntryFormSubmit.java.patch
        2 kB
        Neil Griffin
      3. js-console.txt
        33 kB
        Ken Fyten

        Activity

        Hide
        Ken Fyten added a comment -

        JS Console errors seen with Neil's patches.

        Show
        Ken Fyten added a comment - JS Console errors seen with Neil's patches.
        Hide
        Mircea Toma added a comment -

        Applied Neil's fix. The path prefixes the file upload specific parameters with the portlet namespace.

        Show
        Mircea Toma added a comment - Applied Neil's fix. The path prefixes the file upload specific parameters with the portlet namespace.
        Hide
        Mircea Toma added a comment - - edited

        The JS error is actually caused by a malformed response from the server. The body of the response looks like:

            <div class="icefaces-applicant-portlet ltr liferay-faces-bridge-body" id="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_">
                <div class="clipboard" .....
                .......
            </div>
        
            <div class="icefaces-applicant-portlet ltr liferay-faces-bridge-body" id="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_">
                <div class="clipboard" .....
                .....
            </div>
            <partial-response id="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_">
                <changes>
                    <eval>
                        <![CDATA[ice.notifyOnElementUpdateCallbacks([&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:firstName_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:lastName_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:emailAddress_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:phoneNumber_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:dateOfBirth&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:city_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:postalCode_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f2:j_idt40&#39;]);]]></eval>
                    <update id="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_">
                        <![CDATA[]]></update>
                    <update id="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:javax.faces.ViewState:0">
                        <![CDATA[-8128182440297491728:-4643279179760860996]]></update>
                    <update id="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:javax.faces.ViewState:1">
                        <![CDATA[-8128182440297491728:-4643279179760860996]]></update>
                    <update id="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:javax.faces.ViewState:2">
                        <![CDATA[-8128182440297491728:-4643279179760860996]]></update>
                    <update id="Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:javax.faces.ViewState:3">
                        <![CDATA[-8128182440297491728:-4643279179760860996]]></update>
                    <eval>
                        <![CDATA[var iceFormIdList=['Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1', 'Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f2', 'vvnhvzaf5-0-retrieve-update', 'vvnhvzaf5-0-single-submit']; ice.fixViewStates(iceFormIdList,'-8128182440297491728:-4643279179760860996');]]></eval>
                    <extension aceCallbackParam="validationFailed">{"validationFailed":false}</extension>
                </changes>
            </partial-response>
        

        The first two DIV's have the exact same content which is the actual update of the portlet. As you can see the update is outside the expected partial-response > changes > update > CDATA[] location.

        Show
        Mircea Toma added a comment - - edited The JS error is actually caused by a malformed response from the server. The body of the response looks like: <div class= "icefaces-applicant-portlet ltr liferay-faces-bridge-body" id= "Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_" > <div class= "clipboard" ..... ....... </div> <div class= "icefaces-applicant-portlet ltr liferay-faces-bridge-body" id= "Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_" > <div class= "clipboard" ..... ..... </div> <partial-response id= "Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_" > <changes> <eval> <![CDATA[ice.notifyOnElementUpdateCallbacks([&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:firstName_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:lastName_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:emailAddress_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:phoneNumber_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:dateOfBirth&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:city_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1:postalCode_input&#39;,&#39;Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f2:j_idt40&#39;]);]]></eval> <update id= "Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_" > <![CDATA[]]></update> <update id= "Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:javax.faces.ViewState:0" > <![CDATA[-8128182440297491728:-4643279179760860996]]></update> <update id= "Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:javax.faces.ViewState:1" > <![CDATA[-8128182440297491728:-4643279179760860996]]></update> <update id= "Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:javax.faces.ViewState:2" > <![CDATA[-8128182440297491728:-4643279179760860996]]></update> <update id= "Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:javax.faces.ViewState:3" > <![CDATA[-8128182440297491728:-4643279179760860996]]></update> <eval> <![CDATA[ var iceFormIdList=['Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f1', 'Pluto_com_liferay_faces_demo_icefaces_applicant_portlet_6_0_0_SNAPSHOT_1__1031225845_0_:f2', 'vvnhvzaf5-0-retrieve-update', 'vvnhvzaf5-0-single-submit']; ice.fixViewStates(iceFormIdList,'-8128182440297491728:-4643279179760860996');]]></eval> <extension aceCallbackParam= "validationFailed" >{ "validationFailed" : false }</extension> </changes> </partial-response> The first two DIV's have the exact same content which is the actual update of the portlet. As you can see the update is outside the expected partial-response > changes > update > CDATA[] location.
        Hide
        Neil Griffin added a comment -

        I'm researching the problem with the divs today and will report back with my findings.

        Show
        Neil Griffin added a comment - I'm researching the problem with the divs today and will report back with my findings.
        Hide
        Neil Griffin added a comment -

        This issue can be closed. The problem with the partial-response is documented in ICE-11253.

        Show
        Neil Griffin added a comment - This issue can be closed. The problem with the partial-response is documented in ICE-11253 .

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Neil Griffin
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: