tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmanola...@yahoo.com
Subject Re: WEB-INF classloading and on the fly compilation
Date Thu, 14 Sep 2000 16:44:50 GMT
:-)

> Just imagine that this thing we have to compile DEPENDS on another JAR
> included in our little web-app (maybe a set of utility classes, maybe
> whatever, I have the classes somewhere in the WEB-APP).

AFAIK jasper is passing CLASSPATH explicitely ( using -classpath
parameter). I don't know what's wrong with javac ( or if something is
wrong at all - after all we are doing a hack to load javac, I don't think
there is any documentation saying that calling sun.tools.javac.Main is
supposed to work ). Same for Ant - it creates a -classpath argument.

Since you may want to support jikes and out-of-process compilation (with
exec ) I think you'll have to pass the class path explicitely.

Of course, it is not possible from a "standard" servlet to do that - since
the classpath is not available in any standard way. Tomcat provides an
attribute for that in order to hack jasper in.

You could also find the webapp root ( getRealPath("/") ) and compute the
classpath yourself - but I would say this is worse, since you'll rely on a
run-time directory structure that may not exist ( again, war file format
is a deployment format, not a run-time format ).


Costin



Mime
View raw message