You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2006/04/11 22:47:15 UTC

DO NOT REPLY [Bug 39276] New: - [fileupload] add support for Servlet 2.3 filters

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39276>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39276

           Summary: [fileupload] add support for Servlet 2.3 filters
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: File Upload
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: stephen.butler@gmail.com


With Java Servlets 2.3 each servlet can have a filter filter chain that wraps
around the "service" call. This set of patches and files enables parsing of
multipart requests in the filter. A new ServletRequest wrapper is created which
exposes the FileUpload objects to the servlet later. Several things to note:

1) Servlets can check to see if it is a multipart request with the statement:

if (request instanceof FileUploadServletRequest) { /* ... */ }

2) FileItem objects are exposed in FileUploadServletRequest through an API
similar to the standard getParameter() API. For example,
FileUploadServletRequest implements:

FileItem getFileItem( String name );
FileItem[] getFileItemValues( String name );
Enumeration getFileItemNames();
Map getFileItemMap();

3) Any simple form fields are automatically made available through the
getParameter() API. These fields are merged with any other fields the servlet
request might have already contained (ie: through query parameters). This allows
developers to easily extend existing servlets with mutlipart requests.


These patches have only been superficially tested and no JUnit tests have been
written. I look forward to suggestions and comments (I'm also subscribed to
commons-dev, so discussion can take place there if that's more convenient).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 39276] - [fileupload] add support for Servlet 2.3 filters

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39276>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39276





------- Additional Comments From stephen.butler@gmail.com  2006-04-11 21:48 -------
Created an attachment (id=18072)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18072&action=view)
patch to add dependency on commons-beanutils


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 39276] - [fileupload] add support for Servlet 2.3 filters

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39276>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39276


martinc@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE




------- Additional Comments From martinc@apache.org  2006-04-11 21:57 -------


*** This bug has been marked as a duplicate of 20523 ***

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 39276] - [fileupload] add support for Servlet 2.3 filters

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39276>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39276





------- Additional Comments From stephen.butler@gmail.com  2006-04-11 21:49 -------
Created an attachment (id=18073)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18073&action=view)
class for
src/java/org/apache/commons/fileupload/filter/FileUploadServletRequest.java


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 39276] - [fileupload] add support for Servlet 2.3 filters

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39276>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39276





------- Additional Comments From stephen.butler@gmail.com  2006-04-11 21:49 -------
Created an attachment (id=18074)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18074&action=view)
class for src/java/org/apache/commons/fileupload/filter/FilterFileUpload.java


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 39276] - [fileupload] add support for Servlet 2.3 filters

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39276>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39276





------- Additional Comments From stephen.butler@gmail.com  2006-04-11 21:52 -------
I forgot to mention that this adds a dependency on commons-beanutils. This is
because the parameters to FileItemFactory and ServletFileUpload can be
configured through the webapp deployment descriptor. For example, if you wanted
to set a max upload of 100000000 and a temp directory of /tmp, your filter
section would look like this:

    <filter>
        <filter-name>FileUploadFilter</filter-name>
       
<filter-class>org.apache.commons.fileupload.filter.FilterFileUpload</filter-class>

        <init-param>
            <param-name>sizeMax</param-name>
            <param-value>100000000</param-value>
        </init-param>

        <init-param>
            <param-name>FileItemFactory.repository</param-name>
            <param-value>/tmp</param-value>
        </init-param>
    </filter>


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org