Skip to content

Jetty 11 and commons-fileupload

I am updating Jetty9 to Jetty11. I updated my package from javax.servlet to jakarta.servlet because servlet 5.0 is the prerequisite for Jetty11. but the problem is when I am using commons-fileupload`-1.4.jar as it is still using java.servlet package.


The above method is expecting argument from java.servlet package.

Latest version for commons-fileupload –

Do we have any way to overcome this problem?


commons-fileupload is not required from Servlet 3.1 onwards.

In fact, using commons-fileupload in combination with the a container that supports Servlet spec 3.1 (or newer) is actually not recommended.

There hasn’t even been a release of commons-fileupload since 2018, and no releases that support Servlet 3.1 or newer (the last release of commons-fileupload supports Servlet 2.4 and older)


The Multipart features are built into the Servlet spec since 3.1.

Every server that supports Servlet 3.1 supports multipart file upload now.

That includes Jetty 9.

Use HttpServletRequest.getPart() API in code. You configure it via either the @MultipartConfig annotation and/or the <multipart-config> descriptor element in your WEB-INF/web.xml


See also past answers on these features.