May I suggest one wacky idea? I'm not saying this is GOOD or anything, but it's probably a bit outside the box, for whatever that's worth...

What if you had all your common JSPs in a given directory, like so (let's talk Tomcat for a minute, but it doesn't matter)...

/tomcat/webapps/commonjsps
/tomcat/webapps/webapp1
/tomcat/webapps/webapp2

Then, in either webapp1 or webapp2, let's say you want to use the JSP myJSP1.jsp in the common jsps directory... What if you had a JSP in webapp1 and webapp2 that was just this:

<%@ page language="java" %>
<%@ include file="../commonjsps/myJSP1.jsp.inc" %>

My syntax might be a little off, but I think the concept is clean. You would have to have basically a "dummy" page that includes the real page, and that could be a pain, but I think this would work, and maybe it's quicker to do than a custom resource loader.

Just a thought.

Frank

From: "Keene, David" <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Subject: Custom resource loader
Date: Thu, 10 Jun 2004 10:43:18 -0700

Greetings,

A while ago on this list I saw some discussion about custom resource
loaders (extending FileDirContext) to load resources from multiple root
paths.

I am looking specifically to do this in order to grab jsp pages from a
'commons' directory that many of my sites (which run in different
contexts) use.

Was there any consensus to the right way to do this?  Has anyone done
this already and would be willing to share?

My plan is to send an extra attribute to the Resource tag in the
server.xml, which is a comma delimited list of additional paths in the
order they should be searched for a given file. The ExtendedDirContext
would then keep all the paths on a list and iterate through them until a
named resource was located.

Any thoughts,

Dave Keene





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


_________________________________________________________________
Looking to buy a house? Get informed with the Home Buying Guide from MSN House & Home. http://coldwellbanker.msn.com/



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



Reply via email to