Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2772

Multipart Command Implementation

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.3.0
    • 1.4.x
    • Core
    • None
    • Operating System: other
      Platform: Other
    • 38613

    Description

      I'm proposing that the multipart processing be separated out into a set of
      Commands in a separate chain:

      <!-- ========== Mulitpart Processing chain ========== -->
      <chain name="process-multipart">

      <!-- Check if the request is a multipart request -->
      <command className="o.a.s.c.c.servlet.CheckIfMultipartRequest"/>

      <!-- Create the multipart handler -->
      <command className="o.a.s.c.c.CreateMultipartHandler"/>

      <!-- Wrap the multipart request -->
      <command className="o.a.s.c.c.servlet.WrapMultipartRequest"/>

      <!-- See if the Struts Multipart Handler can process the request -->
      <command className="o.a.s.c.c.servlet.StrutsMultipartHandler"/>

      </chain>

      The main "process-action" chain would be modified to use a LookupCommand that
      ignores the result of this new "process-multipart" chain. This will allow
      multiple multipart handlers to be added to the chain, with the one that
      actually handles the request returning "true" to stop processing of
      the "process-multipart" chain (but not "process-action" chain).

      This proposal has a number of benefits:

      1) All mutlipart handling is now in Commands which can easily be configured

      2) Removed request "wrapping" code from ComposableRequestProcessor - no need to
      sub-class ComposableRequestProcessor to modify the "wrapping".

      3) RequestUtils's static populate() method is redundant - all that code is now
      in commands - making custom multipart (and form population) processing much
      easier.

      4) Multiple multipart handlers can be easily configured by simply adding
      additional commands to the multipart chain.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              niallp Niall Pemberton
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: