Tomcat JSP, Eclipse JDT Compiler, Ant
JavaServerPages are compiled in Tomcat using the Eclipse JDT compiler, which came bundled with Apache Tomcat since version 5.5. The Tomcat Eclipse JDT compiler is newer than the command line javac compiler, is written in pure Java, tends to have fewer memory leaks, and thus it is better for rendering Tomcat JSP pages. Tomcat does not require the JDK’s Java compiler because Tomcat bundles and uses the Eclipse JDT compiler.
Users of Apache Tomcat are not restricted to the native JDT java compiler—changing some settings will allow you to compile JSP pages in Tomcat using Apache Ant. While Apache Ant uses the javac compiler, you may configure Ant to use any supported Java compiler.
If you are encountering a Tomcat JSP error or any number of Tomcat JSP problems, you can make some changes to switch from using the default Eclipse JDT compiler to the compiler task in Apache Ant. This involves several steps beginning with moving the jasper-compiler-jdt.jar file away from the common class loader, then installing Apache Ant’s ant.jar file into the lib/ directory, and finally adding JDK’s’s tools.jar file to the lib/ directory, as described by Jason Brittain in his book Tomcat: The Definitive Guide, Second Edition (see page 55).
Tomcat compiling JSPs using JDT rather than Ant will then be a distant memory. When Tomcat starts, it will use Apache Ant's compiler, by default javac.
Comments on this post:
Submitted by Anonymous (not verified) on Wed, 2010-02-03 09:55. #
I'm having problems with tomcat context memory... anyone out there?



