How to enable Eclipse's JDT Compiler for JSP compilations in GlassFish

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:

  1. jasper-compiler-jdt.jar: This JAR file has been taken unmodified from a Tomcat 5.5 binary distribution.

  2. jasper-compiler-jdt-ext.jar: This JAR file contains a version of Tomcat's org.apache.jasper.compiler.JDTCompiler which has been recompiled against the com-sun-commons-logging.jar from GlassFish.

    This recompilation step has been necessary because Tomcat's org.apache.jasper.compiler.JDTCompiler extends org.apache.jasper.compiler.Compiler and accesses the log instance variable of its superclass. Notice that while the type of the log instance variable in Tomcat is org.apache.commons.logging.Log, it was changed to com.sun.org.apache.commons.logging.Log in 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.

Comments:

[Trackback] GlassFish v2 beta (called Milestone4) is out! Come to learn what's new for the Web Container.

Posted by Jean-Francois Arcand's Blog on January 24, 2007 at 11:57 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

jluehe

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today