Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [servlet-dev] Non-blocking alternative to javax.servlet.http.HttpServletRequest#getPart?

A request with `Content-Type: multipart/form-data` is an interesting place for establishing the async I/O patterns from Servlet 3.1.

Some thoughts.

Servlet 4.x will likely not be updated, as the project is moving to Jakarta EE 9 which is just Servlet 4.0 with the namespace change.
Any new features will likely be part of Servlet 5.x on the jakarta namespace, and Jakarta EE 10.

Each part would need it's own Async I/O behavior, with their own InputStream (and Charset) passed along with all of the part specific headers.

Since we are working with a form, what is the nature of the request if a partial / incomplete / bad form is detected half way through?
How is this communicated via the API?  There needs to be part level failure, and overall form level / request failure.

Currently, If the form is bad, the Container can communicate this back via the HttpServletResponse.
But if we go Async, then the app has the ability to generate a HttpServletResponse that is nonsensical for the validity of the form as a whole.

If the app is using this proposed new API, what does container do with the existing .getParts() / .getPart(), / and .getParameter() level APIs?
Are they expected to continue to work?  (I say yes, as the Servlet could be expecting it in async, but a Filter, or Security component might not be)


On Mon, Dec 9, 2019 at 2:41 AM Behrang Saeedzadeh <behrangsa@xxxxxxxxx> wrote:

Hi all,

Any thoughts about adding non-blocking multipart data handling to Servlet 4.x? For example by adding:

  • onPartDataAvailable(String partName)
  • onAllPartDataRead(String partName)
  • etc.

(similar to javax.servlet.ReadListener, but multipart-centric).

_______________________________________________
servlet-dev mailing list
servlet-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/servlet-dev

Back to the top