Jan Luehe's Blog
How to enable Eclipse's JDT Compiler for JSP compilations in GlassFish
How to enable Eclipse's JDT Compiler for JSP compilations in GlassFish
A repeated request heard on the GlassFish developer forums has been the ability to use the Eclipse Java Development Tools (JDT) Compiler (instead of the javac from Sun's SDK) for JSP compilations.The Eclipse JDT Compiler is used as the default compiler in Tomcat 5.5, and included with Tomcat's binary distribution.
This blog lists the steps required to use the JDT Compiler for JSP compilataions in GlassFish. Starting with the upcoming GlassFish Promoted Build v2 10 (which will be available from the GlassFish download page), it will be possible to enable the JDT compiler from Eclipse for JSP compilations in GlassFish, by adding the following two JAR files to your ${GF_HOME}/lib directory:
jasper-compiler-jdt.jar: This JAR file has been taken unmodified from a Tomcat 5.5 binary distribution.jasper-compiler-jdt-ext.jar: This JAR file contains a version of Tomcat'sorg.apache.jasper.compiler.JDTCompilerwhich has been recompiled against thecom-sun-commons-logging.jarfrom GlassFish.This recompilation step has been necessary because Tomcat's
org.apache.jasper.compiler.JDTCompilerextendsorg.apache.jasper.compiler.Compilerand accesses theloginstance variable of its superclass. Notice that while the type of theloginstance variable in Tomcat isorg.apache.commons.logging.Log, it was changed tocom.sun.org.apache.commons.logging.Login GlassFish, for the reasons explained here.
Notice that when using the default ant/javac based compiler in GlassFish, the fork initialization parameter of the org.apache.jasper.servlet.JspServlet defined in your domain's default-web.xml is used to specify whether javac compilations are to be performed in process or forked to a separate process. By default, fork is set to TRUE, to avoid memory leak and file locking problems that have been observed with javac. The fork init parameter is ignored by the JDTCompiler, which always runs in process.
Posted at 11:30AM Jul 11, 2006 by Jan Luehe in Sun | Comments[1]
Posted by Jean-Francois Arcand's Blog on January 25, 2007 at 07:57 AM PST #