tomcat-users mailing list archives

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

Jsp's unders tomcat 4.1.30 return an emtpy
request.getInputStream.

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>
<%
java.io.Reader in = request.getReader();
int c = -1;
while ( (c = in.read()) != -1) {
	out.print((char)c);
	}
%>
--------------------------------------

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

This is ridiculous. Am I missing something ?

--j


	
		
__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message