On Sat, Apr 17, 2021 at 9:42 AM John English <[email protected]> wrote:

> On 16/04/2021 18:18, Eitan Rosenberg wrote:
> >
> > I have been using Jetty 9 with commons-fileupload  for my own private
> > use for some time.
> > https://commons.apache.org/proper/commons-fileupload/
> > <https://commons.apache.org/proper/commons-fileupload/>
>
> I had some problems with commons-fileupload recently. Someone pointed
> out that it's file uploading is supported natively in the servlet spec,
> as javax.servlet.http.Part and is quite easy to use. I converted my code
> quite easily -- the only hassle is that servlets using it need to have a
>      <multipart-config/> tag inside the <servlet> setup in the web.xml.
>
> I believe that this also exists as jakarta.servlet.http.Part, so this
> might be the way to go.
>

I wholeheartedly support using jakarta.servlet.http.Part (or the older
javax.servlet.http.Part)

If you define your servlets with annotations, you can also use
the @MultiPartConfig annotation (instead of defining it in the web.xml)

   - Jetty 9 / Java EE 7 -
   
https://docs.oracle.com/javaee/7/api/javax/servlet/annotation/MultipartConfig.html
   - Jetty 10 / Jakarta EE 8 -
   
https://github.com/eclipse-ee4j/servlet-api/blob/4.0.4-RELEASE/api/src/main/java/javax/servlet/annotation/MultipartConfig.java
   - Jetty 11 / Jakarta EE 9 -
   
https://github.com/eclipse-ee4j/servlet-api/blob/5.0.0-RELEASE/api/src/main/java/jakarta/servlet/annotation/MultipartConfig.java

- Joakim
_______________________________________________
jetty-users mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users

Reply via email to