cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <>
Subject Re: [C2.0] Source resolution in servlet container
Date Thu, 01 Nov 2001 18:50:26 GMT
> 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.

XSP pages can be compiled before application deplyoment into classes, then
Cocoon will simply use ready-to-use classes instead of compiling them. This
way works that *blessed* IONA iPortal, which during deployment compiles your
JSP pages into servlets, add them to your web.xml and does not even include
the JSP source files into the resulting archive (EAR).

This can be made as an option - compile on fly or use compiled classes.

What do you think?

    Konstantin Piroumian

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

To unsubscribe, e-mail:
For additional commands, email:

View raw message