Bernhard Huber wrote:
> 
> hi,
> i think there is no official way to scan a directory.
> btw why does cocoon needs to load the jars from
> WEB-INF/lib?
> I think that's the task of the servlet-engine to load
> the jars residing in /WEB-INF/lib, and to load classes
> residing in /WEB-INF/classes (sub)directories.

Stupid javac uses its own classloader and not the one it's running in!

So we have to create a "virtual classpath" for it which clearly sucks
(big time, in fact, it's everything possible against good java design
practices) but it's the only semi-portable way to do it or your XSP will
trigger a bunch of errors complaining about not finding classes and
such.

The best solution would be a java compiler engine that is capable of:

 1) use the classloader it resides in to find for classes to import
 2) compile the class given a stream and not force to write source files
on disk (unlike stupid javac!)

But there is no such compiler available in the world (as far as I know)
so, either we write ours (should not be that hard with a combination of
javacc and BCEL, but still a major pain in the butt) or we remove all
on-fly code compilation stuff.

We choose the second option, but many will still want XSP even in the
future so looking for a solution to the first is probably a more
professional way of doing it.

But I don't want to write a java compiler, no thanks :)

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<[EMAIL PROTECTED]>                             Friedrich Nietzsche
--------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to