ICEfaces
  1. ICEfaces
  2. ICE-8127

ace:fileEntry dependent on incorrect value returned from portlet bridge ExternalContext.getRequestContentType()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.0.1, 2.0.2, 3.0, 3.0.1
    • Fix Version/s: 3.1.0.BETA1, 3.1
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Portlet Environment
    • Assignee Priority:
      P2
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      For now, I've added some code in the bridge to detect the presence of ICEfaces 3.0.x/2.0.x which will prevent ace:fileEntry from failing.
      Show
      For now, I've added some code in the bridge to detect the presence of ICEfaces 3.0.x/2.0.x which will prevent ace:fileEntry from failing.

      Description

      Recently I fixed a TCK failure in Liferay Faces Bridge regarding ExternalContext.getRequestContentType():
      http://issues.liferay.com/browse/FACES-1226

      The method used to return "text/html" but with the FACES-1226 it returns "multipart/form-data; ..." and this is changing the behavior of the following method in FileEntryResourceHandler:

      {code}
          @Override
          public boolean isResourceRequest(FacesContext facesContext) {
              ExternalContext externalContext = facesContext.getExternalContext();
              String reqContentType = externalContext.getRequestContentType();
              
              if ( (null == reqContentType) ||
                      !reqContentType.startsWith("multipart") ) {
                  return wrapped.isResourceRequest(facesContext);
              }
      {code}

      Because of this, ace:fileEntry is causing the following stacktrace:

      21:05:14,993 ERROR [ExceptionHandlerAjaxImpl:57]
      java.lang.NullPointerException
      at org.icefaces.apache.commons.fileupload.servlet.ServletFileUpload.isMultipartContent(ServletFileUpload.java:68)
      at org.icefaces.ace.component.fileentry.FileEntryPhaseListener.beforePhase(FileEntryPhaseListener.java:114)
      at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at com.liferay.faces.bridge.BridgePhaseResourceImpl.execute(BridgePhaseResourceImpl.java:109)

        Activity

        Hide
        Deryk Sinotte added a comment -

        Checked in an update to ServletFileUpload.isMultipartContent to check if the getMethod returns a null value. As per ICE-6371, the getMethod() call doesn't exist in the ExternalContext API and is only available on a subset of the various types of requests that portlets can provide. This won't affect PortletFaces Bridge and will allow Liferay Faces Bridge to work without requiring the special handling for ICEfaces.

        Show
        Deryk Sinotte added a comment - Checked in an update to ServletFileUpload.isMultipartContent to check if the getMethod returns a null value. As per ICE-6371 , the getMethod() call doesn't exist in the ExternalContext API and is only available on a subset of the various types of requests that portlets can provide. This won't affect PortletFaces Bridge and will allow Liferay Faces Bridge to work without requiring the special handling for ICEfaces.
        Hide
        Neil Griffin added a comment -

        Here is another related issue in the Liferay Issue Tracker:
        http://issues.liferay.com/browse/FACES-1228

        Show
        Neil Griffin added a comment - Here is another related issue in the Liferay Issue Tracker: http://issues.liferay.com/browse/FACES-1228

          People

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

            Dates

            • Created:
              Updated:
              Resolved: