You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Bojan <bo...@aim.ac.yu> on 2005/02/15 18:11:37 UTC
HttpServletRequest.getInputStream(), InputStream.read() doesn't work (it blocks) if tomcat uses apache as frontend. Any idea?
Hi,
1) I am trying to send some data (content of a file)from an standalone command
line application to the servlet over the (http) stream. It works well.
2) When I am using apache as frontend to the tomcat, servlet blocks.
It blocks when I try to read input stream:
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
BufferedReader inputFromClient = null;
PrintWriter out = null;
BufferedWriter impFileWriter = null;
// BufferedReader inTest = null;
try {
// get an input stream from the applet
inputFromClient = new BufferedReader(new
InputStreamReader(request.getInputStream()));
show("Connected");
// writng initialization
impFileWriter = new BufferedWriter(new FileWriter(importFile));
// read the serialized student data from applet
show("Importing data...");
String str;
while ((str = inputFromClient.readLine()) != null) {
show(str);
impFileWriter.write(str);
impFileWriter.flush();
}
3) InputStreamReader.ready() returns false....
Thoughts?
Thnx, Bojan
--
Open WebMail Project (http://openwebmail.org)
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org