Uploaded image for project: 'Click'
  1. Click
  2. CLK-252

Context does not cater for multivalue parameters on multipart requests

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      1.4.1rc1

      Description

      Context does not cater for multivalue parameters on multipart requests.

      Jakarta FileUpload is used to parse multipart requests, and it does support multi value parameters.

      Need to patch net.sf.click.Context appropriately.

        Activity

        Hide
        sabob Bob Schellink added a comment -

        Attached is revision 1. The implementation details are as follows:

        1) The Context request is wrapped by a custom HttpServletRequestWrapper. The custom wrapper is returned to users when calling Context.getRequest().
        2) The new methods getRequestParameter, getRequestParameterMap and getRequestsParameterNames just forward to the request wrapper.
        3) Both request parameters and file items are placed in a separate map. Each map is keyed on he request parameter name, and the values are either an array of Strings or an array of FileItems. A new method getFileItem(String name) was added. getFileItem has the same behavior as request.getParameter(String).

        The reason for wrapping the request in a custom wrapper is so that the same result will be returned whether a user calls Context.getRequestParameter or Context.getRequest().getParameter. Context.getRequestParameter just serves as a convenience method like Context.getRequestAttribute.

        Note: this is just a first revision and I will make changes as necessary.

        Show
        sabob Bob Schellink added a comment - Attached is revision 1. The implementation details are as follows: 1) The Context request is wrapped by a custom HttpServletRequestWrapper. The custom wrapper is returned to users when calling Context.getRequest(). 2) The new methods getRequestParameter, getRequestParameterMap and getRequestsParameterNames just forward to the request wrapper. 3) Both request parameters and file items are placed in a separate map. Each map is keyed on he request parameter name, and the values are either an array of Strings or an array of FileItems. A new method getFileItem(String name) was added. getFileItem has the same behavior as request.getParameter(String). The reason for wrapping the request in a custom wrapper is so that the same result will be returned whether a user calls Context.getRequestParameter or Context.getRequest().getParameter. Context.getRequestParameter just serves as a convenience method like Context.getRequestAttribute. Note: this is just a first revision and I will make changes as necessary.
        Hide
        medgar Malcolm Edgar added a comment -

        Patches applied to SVN. Will be available in release 1.4RC2.

        thanks for you help with this.

        regards Malcolm Edgar

        Show
        medgar Malcolm Edgar added a comment - Patches applied to SVN. Will be available in release 1.4RC2. thanks for you help with this. regards Malcolm Edgar

          People

          • Assignee:
            sabob Bob Schellink
            Reporter:
            sabob Bob Schellink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development