Conversation
|
|
||
| InputStream input = fileStream.openStream(); | ||
| for ( Part part : request.getParts() ) { | ||
| InputStream input = part.getInputStream(); |
There was a problem hiding this comment.
🙆♂️ that's some nice simplification!
|
|
||
| // Jetty requires a setting of this annotation object as a request attribute. | ||
| private static MultipartConfigElement multipartConfigElement = new MultipartConfigElement(""); | ||
| private static String multipartAttributeName = org.eclipse.jetty.server.Request.__MULTIPART_CONFIG_ELEMENT; |
There was a problem hiding this comment.
Do you know if this __MULTIPART_CONFIG_ELEMENT attribute was created this way to discourage external use?
There was a problem hiding this comment.
Hm, can't find any note saying that, so probably just a different way to name constants I guess. https://github.com/eclipse/jetty.project/blob/410e9db837c964bfcb27ff01693eb77a45dcd60f/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java#L144
There was a problem hiding this comment.
Do you know if this __MULTIPART_CONFIG_ELEMENT attribute was created this way to discourage external use?
I'll check some more. Using the annotation @MultipartConfig on FusekiFilter does not work (it's not a servlet).
The name is Jetty specific which is why it is protected by the getAttribute. Jetty source code likes leading _'s. See org.eclipse.jetty.server.Request.
I'm unsure if Tomcat needs anything special. I haven't managed to find a mention one way or the other.
got me to:
https://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes
Set allowCasualMultipartParsing.
There was a problem hiding this comment.
There is no rush to complete this.
@kinow - thanks for catching the issues - I hadn't noticed that the constant was Jetty-specific.
With various other things doing on, clarifying the situation for Tomcat may not get done for 4.7.0.
There may be a way to automatically programtically set allowCasualMultipartParsing in Tomcat, otherwise the user needs to set it in their context.xml.
Marked as "draft" to avoid accidentally merging!
|
Not for 4.7.0. Until the Tomcat situation is cleared up, this can wait. (On the complete migration to "jakarta", the war file wil only run in Tomcat10, whereas no it only runs in Tomcat <=9 - ther is a converter tool.) |
9ca04ba to
1b8fc93
Compare
|
Now supports Tomcat 8 and 9 as well as Jetty 10. Tomcat 10 uses packages from |
GitHub issue resolved #1643
Pull request Description:
See #1643
Tested for Jetty 10.
It uses Servlet API 3.0 which Tomcat has supported since version 7.
This PR removes the
commons-fileuploaddependency which is no longer used.https://issues.apache.org/jira/browse/FILEUPLOAD-309
By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.