I used to use a servlet to see my System.out. The main part of the
servlet looks like:
PrintStream ps = new
PrintStream(response.getOutputStream());
System.setOut(ps);
System.setErr(ps);
System.out.println("Servlet Debugging Tool");
System.out.println("----------------------\n");
while (true)
{
synchronized(this)
{
try
{
wait(10000);
}
catch (InterruptedException e)
{
System.err.println(e);
}
}
ps.flush();
}
It seats there and wait for any system.out or system.err and display it
on the browser. I am using it on Linux5.2/jserv1b5, but when I tried to
use this on NT40/jserv1b5 it does not work. I found that the output does
not get sent to the browser until the servlet call the out.close();. You
can see I added a ps.flush(), but it didn't help.... If I put a
ps.close() after the ps.flush() it does throw the output, but of course
it won't work the way I want....
Is it a bug on jserv or NT?
Rodrigo
-- --------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]