When I needed to see stdout from my servlet, I set up JServ so that
the backend was running in a "normal" VM that I started.

In Apache's httpd.conf, set ApJServManual to "on". Now when Apache
starts up, it won't fire up a VM to run the back end. Of course,
servlets are now broken until you do it manually...

Then I wrote my own shell script to start the VM. This is on Unix,
your milage may vary. Here's what it does:

#!/bin/sh
JAVA=/usr/local/jdk1.1.7/bin/java
CLASS=org.apache.jserv.JServ
CP=/u/shawntmp/aj10/src/java/ApacheJServ.jar:/usr/local/jsdk2.0/lib/jsdk.jar
http/jserv-demo-80/EnhydraDebugger/enhydra.jar
CONF=/u/http/jserv-demo-80/conf/jserv.properties
CLASSPATH=$CP
export CLASSPATH
$JAVA $CLASS $CONF


Since you start the VM "normally", when your servlet writes to stdout, you 
will see it.




There is another option.... :)
You could try the EnhydraServletDebugger!
This is a servlet that you run in addition to your problem servlet (in the
same zone). You connect to it and run the debugger (the front end is an
applet). You then connect to your own servlet through the debugger, and
it logs all the requests.

This would not show output to stdout. It does not set breakpoints, or step
through your code. It does show you all the detail of the request, the
response, the output (if html or text), and every call your servlet made
to the request/response API (including the results given to your servlet).

So, for example, you would be able to see that your serlvet is asking for
a list of all headers, and see what was given to it. Then you notice that
one of them is spelled differently than you thought. Aha!!!

We have used this kind of debugging for a year now, and it has saved us
many many hours of frustration. Your servlet must be running enough to
handle responses for it to be useful, of course.

Here is some screenshots, so you can get a feel for it:

Request details:   http://www.enhydra.org/media/screenshots/SADebuggerRequest.gif
Servlet API trace: http://www.enhydra.org/media/screenshots/SADebuggerTrace.gif
Response details:  http://www.enhydra.org/media/screenshots/SADebuggerResponse.gif


Here is where to download it:

http://www.enhydra.org/cuts/EnhydraServletDebugger_b1.zip

See the file README.html for installation instructions.

Hope this helps!
   Andy



--
--------------------------------------------------------------
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]

Reply via email to