tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: getPart()/getParts() invocation in the filter ?
Date Thu, 13 May 2010 14:13:20 GMT
On 13/05/2010 03:00, Ivan wrote:
> Hi,
>      While using the new features of getPart()/getParts() in the Servlet 3.0,
> I found that those methods could not be invoked in filter.

The short answer is that this should work, even from a filter.

The long answer is that this discussion belongs on the users list for 
now. If that discussion identifies a bug in the current Tomcat 
implementation then any discussion around fixing that belongs here.

Mar

>      After checking the spec, I found some words below :
>      --->
>      File upload
>       If a request is of type multipart/form-data and if the servlet handling
> the
>       request is annotated using the @MultipartConfig as defined in Section
> 8.1.5,
>       "@MultipartConfig" on page 8-64, the HttpServletRequest can make
> available
>       the various parts of the multipart request via the following methods
>      ■ public Collection<Part>  getParts()
>      ■ public Part getPart(String name).
>      <---
>      --->
>      @MultipartConfig
>       This annotation, when specified on a Servlet, indicates that the
> request it expects
>       is of type mime/multipart. The HttpServletRequest object of the
>       corresponding servlet MUST make available the mime attachments via the
>       getParts and getPart methods to iterate over the various mime
> attachments.
>      <---
>       I am just wondering that :
>       a. Are those two methods available when the request is of
> multipart/form-data type AND the servlet handlering it are configured with
> MultipartConfig (annotation or configurations in web.xml) ? Why not make
> those methods avaible once it detects the multipart/form-data type ?
>       b. Are those two methods only available in Servlet ? Seems that the
> spec expects the users handle the uploading in Servlet ?
>       Thanks !




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


Mime
View raw message