Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakarta.ee-community] Expected behavior of calling javax.servlet.ServletRequest#getInputStream after javax.servlet.http.HttpServletRequest#getPart

The implementation can call reset() on the input stream after getPart() parses it. In Tomcat's case the input stream does not support mark/reset though. 

Also similar to the way that calling getWriter() and getInputStream() on the same request throws IllegalStateException, IMHO calling them after getParts() should also thrown IllegalStateException. Or at least the spec should specify the expected behavior. 

Best regards,
Behrang Saeedzadeh
(Sent from my cellphone.)

On Mon, 9 Dec. 2019, 10:58 am Jan Bartel, <janb@xxxxxxxxxxx> wrote:
Behrang,

 I don't think you will find that this is tomcat-specific. When you call HttpServletRequest.getPart/s, this consumes the input stream of the request body, so naturally you cannot also consume it.
You will find that this is the same on jetty.

Jan

On Mon, 9 Dec 2019 at 10:24, Behrang Saeedzadeh <behrangsa@xxxxxxxxx> wrote:

Hi,

In Tomcat, when I call javax.servlet.ServletRequest#getInputStream after having called javax.servlet.http.HttpServletRequest#getPart, even without performing any operations on the given part, I am getting an empty stream (0-bytes).

Is this in compliance with the spec?

Best regards,
Behrang Saeedzadeh
(Sent from my cellphone.)
_______________________________________________
jakarta.ee-community mailing list
jakarta.ee-community@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jakarta.ee-community


--
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
Expert assistance from the creators of Jetty and CometD

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

Back to the top