Multipart handling is used almost exclusively for file uploads.

When you have an HTML form that needs to upload a file, you need to set the
method to 'POST' and the enctype to 'multipart/form-data'. The browser will
then encode the form data differently than for a regular GET or POST. This
encoding has to be reversed at the server side so that the request can be
processed.

The Servlet spec does not address 'multipart/form-data' at all. Why, I have
no idea. As a result, it is handled in a variety of different ways in
different environments. Some containers (e.g. Resin) provide built-in
support. Many people use an implementation from O'Reilly (the publishing
company). Struts provides its own handler.

What I am proposing is a change to Struts which would give people the option
of using an alternate handler to the one built in to Struts, without having
to implement the multipart interface used by Struts.

--
Martin Cooper


----- Original Message -----
From: "Thomas Burleson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 22, 2001 7:54 PM
Subject: RE: Disabling Struts multipart handling


> Martin,
> Could you briefly explain the purpose/need for multipart handling.
> Unfortunately, this is a new "issue" for me. What are specific examples
> where this is needed?
>
> Thanks in advance,
> ThomasB
>
> -----Original Message-----
> From: Martin Cooper [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, July 21, 2001 11:39 PM
> To: [EMAIL PROTECTED]
> Subject: Disabling Struts multipart handling
>
>
> Unless I'm mistaken, there is currently no clean way to disable Struts'
> multipart handling mechanism. The class used for the multipart handler can
> be specified in an init-param value, but if that is not supplied, the
> default (DiskMultipartRequestHandler) is used.
>
> Two cases where someone might want to disable Struts' multipart handling
are
> (1) where the container (e.g. Resin) provides multipart handling that is
> adequate for the application's needs, and (2) where the application
> developer wants to use an existing multipart handler (e.g. O'Reilly).
>
> To allow the developer to disable Struts' built-in multipart handling, I
> propose recognizing the special value 'none' for the 'multipartClass'
> init-param. That is, the following, in web.xml, would disable Struts'
> multipart handling:
>
>     <init-param>
>         <param-name>multipartClass</param-name>
>         <param-value>none</param-value>
>     </init-param>
>
> Would anyone have a problem with this? If not, I'll go ahead and make the
> change.
>
> --
> Martin Cooper
>
>
>
>


Reply via email to