tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pier P. Fumagalli" <pier.fumaga...@eng.sun.com>
Subject Re: WEB-INF classloading and on the fly compilation
Date Thu, 14 Sep 2000 22:41:35 GMT
cmanolache@yahoo.com wrote:
> 
> :-)
> 
> > 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.

Really, I wouldn't give a crap to Jikes if I was able to compile from
within a standard WEB-APP...

> 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.

That's a problem related to the compiler, relying on files instead on
classes loaded by the classloaders... I know that at Olliance they're
thinking about distributing WEB-APPs on a set of different servlet
engines (a some sort of load balancing but with more guts :). This will
surely add lots of hacks in class-loading mechanisms, since WEB-APPs
WARs will be loaded from the network and so on...
If the compiler relies on files on the disk, then, we're screwed,
because we cannot possibly have a portable servlet using on-the-fly
compilation...

> 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 ).

Yep... 

	Pier

Mime
View raw message