>Number: 3607
>Category: mod_jserv
>Synopsis: problems reading POST data w/ getReader and GetInputStream
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: jserv
>State: open
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Tue Dec 29 16:40:01 PST 1998
>Last-Modified:
>Originator: [EMAIL PROTECTED]
>Organization:
apache
>Release: Apache 1.3.3 + JServ 1.0b1
>Environment:
Solaris x86 2.7, JDK 1.1.6/1.2.0
>Description:
getReader() and getInputStream() both fail to return anything when used with
a BufferedReader.
I have used the same code with quite a few other ServletRunners - WebSphere,
Zeus, ServletRunner, Java Web Server, and two versions have always worked
flawlessly with BufferedReader.
>How-To-Repeat:
The following servlet code does not work. It causes no exceptions, ready
simply does not ever return true, for either getReader() or getInputStream()
if (aMethod.equals("POST")) {
// This change is to work around a bug in WebSphere
// BufferedReader reader = aRequest.getReader();
BufferedReader reader = new BufferedReader(new
InputStreamReader(aRequest.getInputStream()));
StringBuffer buf = new StringBuffer();
char[] vCharBuffer = new char[1024];
int vNumRead = 0;
while (reader.ready()) {
vNumRead = reader.read(vCharBuffer, 0, 1024);
buf.append(vCharBuffer, 0, vNumRead);
}
content = buf.toString();
}
>Fix:
You guys no doubt no more about java streams than I do. :)
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED. This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig- ]
[nored unless you are responding to an explicit request ]
[from a developer. ]
[Reply only with text; DO NOT SEND ATTACHMENTS! ]