You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Ma...@tivoli.com on 2000/08/01 12:57:30 UTC

Path for jars for jsp compiler

We are using Tomcat in an "embedded" environment.  It is launched within a jvm
that has some limitations
on java.class.path.  We have made some modifications to accomodate this.  We are
looking for a
solution that is consistent with the direction of Tomcat and would prefer a
better solution.

The changes below are to the 7/27 nightly build.

--------------------------------------------------------------------------------------------------------------------

In order to support JSPs (not precompiled) in our embedded environment we need
to get the jar
files associated with tomcat (webserver.jar, etc) and our embedding application
jar files (APIs
needed) into the path searched by the compiler. We have added a system property
(tc_path_add) with these jar files into the list passed to the compiler in
Compiler.java (see 2 lines
added below - lines 199 and 231 in Compiler.java).  We don't want to modify
java.class.path because
other 3rd party code also running in the JVM.

These jar files are not in the java.class.path system property since we use our
own classloaders
(URLClassLoaders). Based on a comment in the code there seems to have been a
jsp.class.path system property in the past that was removed that may have been
used for a
similar purpose. It is possible to get this added back in or is there an
alternative solution in the
works for this type  of problem in the 3.2 timeframe?


=========== jasper/compiler/Compiler.java
=========================================

        // I'm nuking
        //          System.getProperty("jsp.class.path", ".")
        // business. If anyone badly needs this we can talk. -akv

        String sep = System.getProperty("path.separator");
        String[] argv = new String[]
        {
            "-encoding",
            javaEncoding,
            "-classpath",
            System.getProperty("java.class.path")+ sep + classpath + sep +
----->   System.getProperty("tc_path_add") + sep
            + sep + ctxt.getOutputDir(),
            "-d", ctxt.getOutputDir(),
            javaFileName
        };

================================================================================
        /**
         * Configure the compiler object
         */
        javac.setEncoding(javaEncoding);
        javac.setClasspath( System.getProperty("java.class.path")+ sep +
                            System.getProperty("tc_path_add") + sep +
------>                  classpath + sep + ctxt.getOutputDir());
        javac.setOutputDir(ctxt.getOutputDir());

================================================================================


Malcolm (Mac) Herrick MacDonald Holloway
(919) 254-6958
mhollowa@tivoli.com
Service Provider Business Unit

Keep on trunkin'