empty input string
From: No Spam (nospam.invalid_at_verizon.net)
Date: 01/27/04
- Next message: Daniel Sjöblom: "Re: Java soluton for outputting English?"
- Previous message: Joseph: "Re: recursive permutation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Jan 2004 19:43:50 GMT
I have a Java class called from a servlet that runs fine on Win2000
Tomcat but gives an empty InputStream each time I try it on a Unix
Solaris machine. Both the Win2000 PC and Unix machine are using J2SDK
1.4.2 and Tomcat 4.1.24.
At this point I'm just trying to display the request contents. Here is a
snippet:
public void processRequest(HttpServletRequest httpRequest) {
System.out.println("Request length is " +
httpRequest.getContentLength() + " bytes.");
InputStream is = null;
try {
is = request.getInputStream();
}
catch (java.io.IOException e) {
System.out.println("Error getting input stream from HTTP
request.");
}
System.out.println("== BEGIN ==");
try {
java.io.InputStreamReader in = new
java.io.InputStreamReader(is, "UTF-8");
java.io.BufferedReader data = new java.io.BufferedReader(in);
String line;
while ((line = data.readLine()) != null) {
System.out.println(line);
}
} catch (java.io.IOException e) {
System.out.println("IO Error: " + e.getMessage());
}
System.out.println("== END ==");
The content length is always correct so there must be something I am
missing with the input stream.
I see all the request contents on Win2000 but see only
== BEGIN ==
== END ==
on the Unix machine.
This has been quite a sticky problem so ANY help is appreciated.
Thanks,
T
- Next message: Daniel Sjöblom: "Re: Java soluton for outputting English?"
- Previous message: Joseph: "Re: recursive permutation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|