You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "David M. Karr" <dm...@earthlink.net> on 2002/08/01 21:47:56 UTC

Re: JSPC Precompiling Issues and a handy utility

>>>>> "Rick" == Rick Fincher <rn...@tbird.com> writes:

    Rick> Hi All,
    Rick> There has been some discussion on here and on the TAGLIBS list about
    Rick> precompiling JSP's in Tomcat.

    Rick> To avoid confusion, before I go on I want to point out that there has been a
    Rick> change in Tomcat 4.1.8 in the naming conventions of servlets generated from
    Rick> JSP's.

    Rick> In 4.1.8 a JSP file CATALINA_HOME/webapps/myApp/main.jsp gets compiled into
    Rick> a servlet  CATALINA_HOME/work/Standalone/localhost/myApp/main_jsp.java.

    Rick> Prior to 4.1.8 the servlet created was called main$jsp.java.  So they
    Rick> changed the name convention from $jsp.java to _jsp.java.

    Rick> I'll use the 4.1.8 names in this post.

    Rick> Anyway, when I use jspc to precompile I get all the .java files in  , but no
    Rick> class files.  Does jspc only generate the servlet java files?  The whole
    Rick> point of precompiling was to prevent javac from being called to compile
    Rick> those servlets to work around the javac memory leak and speed up page
    Rick> loading.

The Tomcat JspC process only generates the servlet code.  You have to compile
the code yourself.  It's easy enough to set that up as part of your build
process.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSPC Precompiling Issues and a handy utility

Posted by Rick Fincher <rn...@tbird.com>.
Hi David,

Thanks for the response.  I'm using an IDE and all it does is spit out a war
file with the JSP sources and WEB-INF.  I guess it can't use class files
because it has no knowlege of the container environment it will be deployed
in.

So it looks like what I need to do is write an ant script (or somethin
similar) to take the webapp name as an argument and:

1. Call jspc.sh with the appropriate parameters to compile the servlets into
the work directory.
2. Pull the common/lib jars  and common/classes into the classpath.
3. Pull the WEB-INF/lib jars and WEB-INF/classes of the webapp into the
class path
4. Call javac with that classpath and compile all the .java files in the
work directory.

A shell script won't work because the classpath is too long for 1024
character limit, unless I use a shell without that restriction.

Rick
----- Original Message -----
snip
>
> The Tomcat JspC process only generates the servlet code.  You have to
compile
> the code yourself.  It's easy enough to set that up as part of your build
> process.
>
> --
> ===================================================================
> David M. Karr          ; Java/J2EE/XML/Unix/C++
> dmkarr@earthlink.net



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>