tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "D. Stimits" <>
Subject Re: common image practice?
Date Thu, 02 Dec 2004 21:36:35 GMT
QM wrote:
> On Thu, Dec 02, 2004 at 12:51:21AM -0700, D. Stimits wrote:
> : I'm looking for a "good" or "best" practice to deal with site-wide logo 
> : type files...things that will never change, and that every app will want 
> : access to. This is on linux, but enabling sym links just seems to be an 
> : admin/backup complexity,
> True.
> : and duplicating logos in every project also 
> : seems wrong.
> Why so? If you come from a strong C, C++, or systems management
> background, it may be a little tough to swallow at first.  Those are
> venues in which file-level sharing and reuse are helpful.  (Sort of.
> Trying to get apps to share libraries works just fine until version skew
> rears its ugly head.  You'll eventually reach the same impasse trying to
> get webapps to share static content.)

I do come from that background, and I understand what you are saying 
about version skew. What I'm looking at though are logos and for example 
"valid xhtml" png file that w3c provides if you pass their validator. 
They have no logic to them, and will never change. Also a logo, and even 
CSS stylesheets, are something I would really hate to duplicate...doing 
so means that if it changes I can't forget to update all of them at the 
same time. Building a single integrated app would fix this, but then it 
just gets to be bloated.

> Java webapps are different: each one is supposed to be a self-contained
> package that can be dropped into a container for execution.  Even the
> use of {tomcat}/shared/lib is discouraged, as it places a webapp
> dependency outside of the webapp itself.

Unfortunately, this shared directory doesn't seem to work for anything 
but classes. Image files have no way of being deposited here. I totally 
agree on the use of that directory for logic/classes, but I'd love to 
see a search path for image files and maybe CSS files where it first 
searches inside the app context, and then in the shared/ directory. 
Doesn't seem possible.

> You could address your problem at build time instead of runtime: have
> Ant (or whatever) pull the common data into the webapp before it
> packages the WAR file.  If you mix this with your version control
> system, different apps could have different versions of these files as
> their needs diverge.

Having it update at runtime makes theme changes easier, though not much. 
The other concern here is file space from duplication of resources. 
Although I currently do not foresee CSS and theme images as being too 
large to do this, it can easily end up that way in the future. Right now 
I'm leaning towards adding the images to each app, but I'm not 
completely comfortable with this.

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

View raw message