tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent Brucher" <>
Subject RE: Multiple source directories for one webapp
Date Sun, 05 Jun 2005 10:52:22 GMT
Glad to see I'm not alone ;-)

FYI, the tomcat plugin for Eclipse from Sysdeo
contains a classloader that takes classes from various locations.
I've been using it for a while now and it works perfectly.

The equivalent for non-java classes (jsp, html, etc.) is still missing, so
extension to FileDirContext.

I'll have a more finalized version of our solution pretty soon. I'll be more
happy to make it available to whoever might find a need for it.


> -----Original Message-----
> From: Scott Dudley [] 
> Sent: Sunday, June 05, 2005 6:43 AM
> To: Tomcat Users List
> Subject: Re: Multiple source directories for one webapp
> Laurent,
> Exact same scenario here.  I've tried multiple approaches in 
> the past.  I run Eclipse on Linux.  The soft link approach 
> worked but was not trivial to implement.  Your configuration 
> sounds much like mine.  My applications are comprised of 
> multiple sub-projects - each has an html directory, some have 
> overlapping directory trees, etc.
> What I do now is this: I wrote a custom classloader.  Instead 
> of copying my classes to WEB-INF, I use my custom classloader 
> to specify my own CLASSPATH comprised of the classes folders 
> of each applicable Eclipse project.  I then us a shell script 
> which calls rsync to synchronize the html, jsp, and css 
> resources to my installed application folder.  Any time I 
> change a java class, it's automatically exposed to the web 
> app.  For jsp, html, etc. - I run the rsync script.  This is 
> fast and very efficient.
> I'd very much like to hear more about your FileDirContext 
> solution.  Can you share more - either here or off-line?  
> Sample code would be most helpful.
> Ultimately, I too would like to have a solution wherein a 
> change made in Eclipse is dynamically and automatically 
> exposed to my test application without requiring any 
> additional steps.  I had this with the soft link scenario but 
> would like to avoid the complexity if at all possible.
> Thanks.
> Laurent Brucher wrote:
> >Hi all,
> >
> >I guess this is not really new, but I haven't seen any concrete 
> >solution nor much discussion about it.
> >
> >So here's the problem:
> >one webapp composed of multiple pieces (jsp, html, css, 
> etc.) located 
> >at various locations on the filesystem.
> >
> >I know, this goes against the servlet spec. but I've had a need for 
> >this many times by now, especially under development (our 
> projects are 
> >broken down into various modules, each contributing to 
> creating a final 
> >webapp). For production, an ant task will do the job putting all the 
> >pieces correctly together. Under development,
> >I find it unpractical to run an ant task every time a jsp 
> has been modified.
> >
> >We started looking into replacing the resource context with 
> a modified 
> >version of the FileDirContext, with good results so far. 
> This modified 
> >version acts as a directory mapper and, given a requested resource, 
> >provides its correct location on the filesystem.
> >
> >Before continuing further in that direction, I was wondering whether 
> >there may be alternatives solutions to the problem, and also 
> what you 
> >guys think about all this?
> >
> >Thanks,
> >Laurent.
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> >For additional commands, e-mail:
> >
> >
> >  
> >
> -- 
> Regards,
> Scott Dudley
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message