ICEfaces
  1. ICEfaces
  2. ICE-8029

ace:fileEntry not compatible with WSRP

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.1, EE-3.0.0.GA
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Liferay 6.1.10 (EE GA1) or Liferay 6.1.1 (CE GA 2)

      Description

      When running as a local portlet, form input parameters are sometimes namespaced:
      <input name="A5352:l1:c2:f1" type="hidden" value="A5352:l1:c2:f1">
      <input id="A5352:l1:c1:f1:fs1:c1a:firstName" name="A5352:l1:c1:f1:fs1:c1a:firstName" type="text" class="">

      And sometimes they are not -- for example:
      <input name="javax.faces.encodedURL" type="hidden" value="...">
      <input name="ice.window" type="hidden" value="1fh1e17mvw">
      <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="4571555686666700744:2695704879738191029" autocomplete="off">

      (Note that PortletFaces Bridge and Liferay Faces Bridge both try to optimize response namespace (like "A5352") in order to reduce the rendered markup)

      Normal forms with enctype="application/x-www-form-urlencoded" work fine with WSRP, because ICEfaces simply uses ExternalContext.getRequest() and ExternalContext.getRequestParameterMap() in order to determine request parameter values. The portlet container (i.e. Liferay) and portlet bridge handle all namespacing concerns, so that applications run smoothly.

      But with forms with enctype="multipart/form-data", the ICEfaces FileEntryPhaseListener takes full control of the situation, using its own customized version of Apache commons-fileupload.

      When running as a local portlet this works fine, because the parameter names in the multipart form appear exactly as they do in the submitted form, meaning, some are namespaced and some are not. But when running as a remote portlet via WSRP, the WSRP Consumer ALWAYS namespaces the form parameters, and this is causing problems in ICEfaces. For example, take the following line of code from FileEntryPhaseListener:

                      if (key.equals("ice.fileEntry.ajaxResponse")) ajaxResponse = true;

      This fails, because the request parameter value is namespaced to "_1_WAR_icefaces3portlet_INSTANCE_5gRz_ice.fileEntry.ajaxResponse"

      In order to fix this problem, I see one of two approaches:

      1. The processing of form input names needs to detect the presence of a namespace and remove it.

      2. ICEfaces can be refactored to take advantage of the new Ajax file upload capability of Liferay Faces Bridge:
      http://issues.liferay.com/browse/FACES-1191

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Neil Griffin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: