MyFaces Core
  1. MyFaces Core
  2. MYFACES-2688

when form is 'multipart/form-data', form component will never process update.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: JSR-314
    • Labels:
      None
    • Environment:
      mac os x, tomcat.

      Description

      because 'javax.view.id' will not be find in request.getParametersMap, the restore phase executor will stop execute.

      source code:
      package org.apache.myfaces.lifecycle;
      .........
      class RestoreViewExecutor implements PhaseExecutor
      ..........
      public boolean execute(FacesContext facesContext){
      ..................

      if (!errorPageRequest && restoreViewSupport.isPostback(facesContext))

      { ................ }

      ...............
      }

      restoreViewSupport.isPostback(facesContext) will call facesContext.getExternalContext().getRequestParameterMap().get(ResponseStateManager.VIEW_STATE_PARAM)

      but request.parameterMap is empty because of using 'multipart/form-data'.

      restoreViewSupport.isPostback(facesContext) will return false,

      then FacesContext.renderResponse() is called. the whole phasing process is stopped.

      suggestion:

      should wrap request.parameterMap from the first place.

        Activity

        Hide
        Leonardo Uribe added a comment -

        This is not a bug. The spec just doesn't deal with multipart/form-data. Note the is no standard h:inputFileUpload. We can't do anything here for now.

        Each component library handle this case in a different way. For example, trinidad has its own file upload component that requires configure a filter that wraps the request object. Tomahawk has the same, but note both file upload cannot run at the same time. The one that work depends on which filter is on top.

        I'll close this issue as invalid

        Show
        Leonardo Uribe added a comment - This is not a bug. The spec just doesn't deal with multipart/form-data. Note the is no standard h:inputFileUpload. We can't do anything here for now. Each component library handle this case in a different way. For example, trinidad has its own file upload component that requires configure a filter that wraps the request object. Tomahawk has the same, but note both file upload cannot run at the same time. The one that work depends on which filter is on top. I'll close this issue as invalid
        Hide
        Ganesh Jung added a comment -

        We're not bound to support only the spec and if Mark finds a way to support multipart without breaking the rest, maybe it's a good idea to have a look at it?

        Best regards,
        Ganesh

        Show
        Ganesh Jung added a comment - We're not bound to support only the spec and if Mark finds a way to support multipart without breaking the rest, maybe it's a good idea to have a look at it? Best regards, Ganesh
        Hide
        Martin Kočí added a comment -

        h:inputFile is planned for JSF 2.1: https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=690. I don't know exact plan for 2.1 but first milestone (without inputFile) is here: http://wiki.jcp.org/wiki/index.php?page=JSF+2.1+Change+Log so it seems 2.1 is on the way.

        Problem with missing multipart support has many consequencies: this issue, http://www.mail-archive.com/users@myfaces.apache.org/msg55998.html, JSF HTML_BASIC does'nt cover all elements from HTML 4.01, user must use third party uploads (which are incompatible) usw.

        Solution from https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=690 based on decorated ExternalContext.getRequestParameterMap() (Neil's solution) works without problem - I've adated it to servlet enviroment and it works: without a servlet filter, without any third party library and doesn't lose request parameters with multipart request even they comes from a conversation framework.

        I hope this could be in myfaces core now and it does not break compatibility - if so I can provide a patch.

        Show
        Martin Kočí added a comment - h:inputFile is planned for JSF 2.1: https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=690 . I don't know exact plan for 2.1 but first milestone (without inputFile) is here: http://wiki.jcp.org/wiki/index.php?page=JSF+2.1+Change+Log so it seems 2.1 is on the way. Problem with missing multipart support has many consequencies: this issue, http://www.mail-archive.com/users@myfaces.apache.org/msg55998.html , JSF HTML_BASIC does'nt cover all elements from HTML 4.01, user must use third party uploads (which are incompatible) usw. Solution from https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=690 based on decorated ExternalContext.getRequestParameterMap() (Neil's solution) works without problem - I've adated it to servlet enviroment and it works: without a servlet filter, without any third party library and doesn't lose request parameters with multipart request even they comes from a conversation framework. I hope this could be in myfaces core now and it does not break compatibility - if so I can provide a patch.

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Li
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

              Estimated:
              Original Estimate - 120h
              120h
              Remaining:
              Remaining Estimate - 120h
              120h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development