How to implement multipart/form-data request (file upload) handler with JAX-RS without vendor specific libraries? So far I haven't found other way than to inject the HttpServletRequest
and use the Servlet API to access the form data.
Yet HttpServletRequest#getParts()
returns an empty list even the request is well formed (confirmed with Wireshark). I read I have to enable multipart configuration for the Jersey Servlet in the web.xml. However, I'm using @ApplicationPath
annotation to automatically configure JAX-RS. So what is the correct way to handle multipart requests?