How can I ensure that Tomcat compiles servlets with debugging info included (-g option of the javac compiler)?

Michael Dean

Note: This solution applies to Tomcat 4.x.x

Inside Tomcat's default web.xml file (CATALINA_HOME/conf/web.xml) there is a servlet declaration for the "jsp" servlet (which is used to process JSP's).
If you set a servlet parameter named classdebuginfo to true, Tomcat will include debug info.

Following is Tomcat's default declaration with the classdebuginfo parameter added: