You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Daishi Harada <da...@CS.Berkeley.EDU> on 2002/01/03 04:56:34 UTC

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?

TIA,
Daishi

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: How to "include" across contexts/webapps?

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Daishi" == Daishi Harada <da...@CS.Berkeley.EDU> writes:

    Daishi> Hi,

    Daishi> I have what seems like (and probably is) a very simple problem, but I
    Daishi> haven't been able to find a solution. Any help/hints would be
    Daishi> appreciated.

    Daishi> I'm trying to build a website in a typical sort of way, with headers
    Daishi> and footers isolated and "<%@include%>"'ed into the actual
    Daishi> pages. However, now I'd like to modularize somewhat and decompose
    Daishi> parts of the site into their own projects/contexts, while still having
    Daishi> each project share common headers and footers. Unfortunately,
    Daishi> "<%@include%>" is relative to the current context, so I haven't been
    Daishi> able to figure out a good way to share the header/footer information
    Daishi> across each of the contexts/apps. Is there a canonical way of doing
    Daishi> something like this?

You might take a look at the JSTL (JSP Standard Tag Library) at
<http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html>.  It includes
an "import" tag that specifies a URL, which can point anywhere, either relative
or absolute.  I have not used this.

-- 
===================================================================
David M. Karr          ; Best Consulting
dmkarr@earthlink.net   ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


need ur support

Posted by puneet sachar <pu...@yahoo.com>.
hi guys

well all u tomcat cat guys thanx a lot for so many
questions and answers and thanx esp tom 
for being so co-opertaive 

well this is mot any question mail

this is just to inform u all guys Puneet Sachar thatz
me is no longer with shyama software solutions 
due to some dirty unavoidable circumtances i have
resigned form my office and now currently looking for
job

today i suffered a major set back when i came to know
my company director and ceo has installed a software
spectorsoft on machine which track down all events and
mail and password and makes a report...

my boss has hacked my account also he is so rich i
can't thought of logging a fir against him

i request u plz mail to spectorsoft abt the event and
ask them why don't they ensure that every client of
thier follow a guideline before installing the
software ..cos its written over there every employee
should know abt the software being installed on
machine

i'm really upset all my efforts are waisted and i
cannot punish the faulty guy

regards
Puneet

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: How to "include" across contexts/webapps?

Posted by Marcin Jaskula <ja...@expro.pl>.
> > 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?
> >
> 
> 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.

Hi

If you work on UNIX make one directory with the common files and
in each of apps directories make symbolic links to the common dir.
If you modify a file in a common dir you see the changes in all apps
without committing and updating CVS. And you do not need extra
disk space.

Marcin

> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: How to "include" across contexts/webapps?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 2 Jan 2002, Daishi Harada wrote:

> Date: Wed, 02 Jan 2002 19:56:34 -0800
> From: Daishi Harada <da...@CS.Berkeley.EDU>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> 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:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>