Re: Adding common header to all JSP pages

From: Ryan Stewart (zzanNOtozz_at_gSPAMo.com)
Date: 02/10/05


Date: Thu, 10 Feb 2005 06:28:57 -0600


"Maxim Senin/J2EE Experts at www.supremistic.com" <maxim.senin@supremistic.com>
wrote in message news:f1e95$420b0885$436462d4$3411@msgid.meganewsservers.com...
> Hi.
>
> I have a website built with JSP on tomcat 3.2. Currently is uses HTML
> frames for header/body/footer. I want to "flatten" it by getting rid of
> header and footer frames.
Good for you. Frames in general are going away.

> I don't want to do jsp:include or anything like that in every page.
> Stylesheets may not work too: some pages can be displayed on their own, or
> same page can be included into another page, so if I did <jsp:include> on
> every page I'd get duplicated headers/footers.
Look at Tiles. I've only used it as a plug-in for Struts, which I'd also
recommend, but it can be used separately. This might help you start learning
about it:
http://struts.apache.org/userGuide/dev_tiles.html

Off-hand, I can't tell you how to set up up independently of Struts.

> I think that the following would work for me: if I could setup some kind of
> filter for text/html content, that filter would prepend header and append
> footer to ALL pages serving text/html mime type, and i'd do it only once per
> screen.
>
> So how can I set up such a filter in tomcat 3.2? Do I need to change
> web.xml/server.xml or any other configuration files or deployment descripor?
> Is there any other way to do it?
That would be an unusual approach. The concept of filtering is not really for
appending/prepending content to pages.



Relevant Pages

  • Re: Adding common header to all JSP pages
    ... > header and footer frames. ... > filter for text/html content, that filter would prepend header and append ... > So how can I set up such a filter in tomcat 3.2? ...
    (comp.lang.java.help)
  • Re: Adding common header to all JSP pages
    ... frames for header/body/footer. ... header and footer frames. ... filter for text/html content, that filter would prepend header and append ... So how can I set up such a filter in tomcat 3.2? ...
    (comp.lang.java.programmer)
  • Re: Adding common header to all JSP pages
    ... frames for header/body/footer. ... header and footer frames. ... filter for text/html content, that filter would prepend header and append ... So how can I set up such a filter in tomcat 3.2? ...
    (comp.lang.java.help)
  • Re: AIG
    ... Xray has been gone so long his filter timed out;-) ... OVR:0E04 WARNING: Header 'Griffith*' is unobtainable (can't be ...
    (sci.electronics.design)
  • Re: Learning Perl
    ... } header is the header I see most commonly morphed. ... No one is actually bound to conforming to anyone's killfile or filter. ... tossing around the "troll" label much to easily. ...
    (comp.lang.perl.misc)