Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Jetty 12: org.eclipse.jetty.http.MultiPart.Part does not extend Servlet 6 jakarta.servlet.http.Part

Jetty isn't handling the spec in any different way.

Servlet is just an API.
The Servlet API, in Jetty, is implemented on top of the Jetty internal features.

It just happens that the Servlet spec handling for `multipart/form-data` is a simple blocking API.
The Jetty implementation is fully 100% async.

The features you were using are Jetty core API (namely the org.eclipse.jetty.http.MultiPart.Part and MultiPartFormData classes), but you were not using the Servlet API when you were using those classes.

If you want a simple API, use the Servlet spec.
If you want a performant API, use Jetty.
If you want a flexible API, use a 3rd party library on top of the Servlet spec (like commons-fileupload, or commons-mime), which doesn't use the Servlet spec handling of multipart/form-data, but does the reading / parsing itself using the Servlet inputstream (in some cases even using the Servlet AsyncContext).

- Joakim

On Fri, Oct 11, 2024 at 9:10 AM Glen Peterson via jetty-users <jetty-users@xxxxxxxxxxx> wrote:
If Jakarta Servlet 6 (and presumably future versions) and Jetty are Eclipse Foundation technologies and some of the same members work on the Servlet Spec and on Jetty, why is Jetty doing something different from the spec?  If there's a need for change, shouldn't the spec be changed to meet that need too?


Back to the top