On Wed, 2 Jan 2002, Daishi Harada wrote:
> Date: Wed, 02 Jan 2002 19:56:34 -0800
> From: Daishi Harada <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: How to "include" across contexts/webapps?
>
>
> Hi,
>
> I have what seems like (and probably is) a very simple problem, but I
> haven't been able to find a solution. Any help/hints would be
> appreciated.
>
> I'm trying to build a website in a typical sort of way, with headers
> and footers isolated and "<%@include%>"'ed into the actual
> pages. However, now I'd like to modularize somewhat and decompose
> parts of the site into their own projects/contexts, while still having
> each project share common headers and footers. Unfortunately,
> "<%@include%>" is relative to the current context, so I haven't been
> able to figure out a good way to share the header/footer information
> across each of the contexts/apps. Is there a canonical way of doing
> something like this?
>
The fact that includes are context-relative is in the Servlet and JSP
specifications, so we cannot change it.
In my own apps, I accomplish your goal in an indirect manner -- I keep a
single copy of the shared header/footer files in a CVS repository that is
separate from my Tomcat webapps directory. Then, as part of deploying a
particular webapp, I copy in the shared files out of this repository into
*each* webapp that requires them. That way, I still have a single source
file to change in case updates are needed, at the (insignificant) cost of
a little extra disk space.
> TIA,
> Daishi
>
Craig
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>