Oh.. i didnt realize that. I always thought that the JSP would be translated
to a Servlet and from there the regular javac would be involked (like if it
were a Servlet). I didnt know there were tools to by pass the conversion
phase.
I always use the keepgenerated option so I guess that's why its ingrained
like that for me. :P
I guess that native compiler could really be helpful in the initial request
to a jsp though since it would probably speed up that compile time a bit.
-Tim

-----Original Message-----
From: Nic Ferrier [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 3:38 PM
To: [EMAIL PROTECTED]
Subject: Re@ Compiling JSP's


"Chen, Gin" <[EMAIL PROTECTED]> writes:

> There's usually something called jspc that functions like the javac for
> regular .java files. You run that on your .jsp files and it will first
> translate it into a Servlet (with a regular .java extension) before
> compiling it into a .class file.

Not exactly true.

Tomcat has a JSPC and I imagine some other containers do as well but
more often the JSP translation to a Java source file and then to a
class file is done without a separate compiler tool.


> One thing you should know is that a jsp is just another form of a Servlet.
> All jsps will eventually get compiled back to a Servlet.
> Look up jspc for Tomcat and also look up the keepgenerated option. That
will
> keep the .java file that is generated from your Servlet so that you have a
> good idea what it is doing to your JSP page.

JSPC is a translator. It can't actually compile a JSP page, it just
translates the page into a java source file containing a class
decleration (that extends Servlet, in fact HttpJspPage which extends
Servlet).

The java source file is actually compiled using the JDK's internal
compiler (which is accessible as an object) or by using a command
line compiler.


That doesn't mean that's the way JSPs have to be compiled. It's not
necessary to create a .java file and then compile it. I know someone
who is working on a native JSP compiler, that means that no .java
source file is generated, you just get a class file.

The class still extends HttpJspPage though.


Nic

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to