[ 
https://issues.apache.org/jira/browse/GERONIMO-5291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12866435#action_12866435
 ] 

Ivan commented on GERONIMO-5291:
--------------------------------

I checked the spec for file uploading support in Servlet 3.0, please refer to 
the text 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.
<---
>From my understanding, the two methods are expected to invoke in the Servlet, 
>also, those two methods should be avaible when both the conditions are 
>fullfilled :
a. multipart/form-data
b. MultipartConfig is configued
Seems that Tomcat strictly actions accroding to the spec.  I also check the 
Jetty's implementation, it seems that Jetty is more tolerant, it might make the 
getPart/getParts avaible when the mutlpart form data is detected.
Please correct me if I misundstand anything !

> Can not get multipart data sent from html form.
> -----------------------------------------------
>
>                 Key: GERONIMO-5291
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-5291
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: deployment
>    Affects Versions: 3.0
>         Environment: OS:win xp sp2
> Server:Geronimo 3.0 2010.05.06 build
> JDK:1.6
>            Reporter: Lu Jiang
>            Assignee: Ivan
>
> I tried the file upload example.But it fails to output the content of the 
> uploaded file.
> After debugging this example,I found that when using getPart() of 
> HttpServletRequest ,then  we expect to get multipart data sent from html form.
> Part p = ((HttpServletRequest) request).getPart("testFile");
> But actually the object p is null,the multipart data is not caught.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to