Debugging a servlet

This section describes the basic procedure of debugging a servlet. This procedure was tested on WinNT with Sun JVM 1.3 and on Linux with IBM JVM 1.3. At the conclusion of this section there is also a note on debugging Java Server Pages (JSP).

Platform

Default directories

WinNT

C:\jdk1.3 and C:\jsdk2.1

Linux

 /usr/local/IBMJava2-13 and /opt/jsdk2.1

Platform

Batch files

WinNT

%TGH%\bin\win32\DebugServlet.bat

Linux

%TGH%/bin/linux/DebugServlet

Platform

Path

WinNT

C:\jsdk2.1\examples\WEB-INF\servlets

Linux

/opt/jsdk2.1/examples/WEB-INF/servlets

Platform

Batch files

WinNT

%TGH%/bin/win32/DebugServlet.bat

Linux

%TGH%/bin/linux/DebugServlet

The command window does not show any messages, until you perform the following step:

The following messages appear in the command window:

Tip: If you work with the Win platform, and can't see Welcome page, use lowercase letters only for the JSDK path. If this doesn't help, move the DebugServlet.bat file to JSDK folder and run it from there.

Debugging a JSP

In general JSP debugging is possible. However, it's not a transparent process, as one must take into account the specific JSP functionality of a given server. Two main points should be taken into account when considering the possibility of debugging a JSP using Together:

From a http request to a JSP, the server produces Java code, compiles it, and runs it. The debugger cannot trace the indivisual JSP page itself, since that is not Java code. But if, as part of remote processing, the server will run a corresponding method in the .class file that it compiled, then in principle attaching the debugger to that running code is possible.

 Thus, the question is in what functionality is provided by thecific server. If the server:

...then you can set this info in the "Attach to remote process" dialog.

More robust JSP support for specific server platforms is planned for upcoming releases.