tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "j.random.programmer" <>
Subject request.getInputStream/getReader bug in 4.1.30 and beyond ?
Date Wed, 21 Jul 2004 19:30:39 GMT

Jsp's unders tomcat 4.1.30 return an emtpy

If you _don't_ call request.getInputStream in your jsp
but call
request.getReader(), an invalid state exception saying
that the input stream has already been opened.
Clearly, the engine
is opening the inputstream behind the scenes and
reading all
it's input. That's wrong, non-spec behavior.

For example:
----------- hello.jsp -------------
hello world
<h2>POST PARAMS</h2>
<% in = request.getReader();
int c = -1;
while ( (c = != -1) {

If any form is posted to hello.jsp (i.e, the action of
form is set to hello.jsp), then when the form is
hello.jsp will crap out. [if you replaces getReader()
in the
above code with getInputStream, the returned input
will be empty].

This is ridiculous. Am I missing something ?


Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message