tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From August Detlefsen <augustd...@yahoo.com>
Subject Re: triggering JSP page recompilation
Date Fri, 01 Feb 2002 22:10:44 GMT
If you are using includes for things like header and footer, have you
considered forwarding body content to a template page instead? 

Using the Jakarta-Taglibs request library: 

http://jakarta.apache.org/taglibs/doc/request-doc/intro.html

You can do something like this: 

BODY PAGE: 

<%@ taglib uri="request.jar" prefix="req" %>

<req:setattribute name="content">

(HTML, JSP, etc - Whatever needs to go in the body of the page goes
here...)

</req:setattribute>

<jsp:forward page="/template.jsp" />


TEMPLATE PAGE (template.jsp): 

(HTML header)

(HTML sidebar)

<%= request.getAttribute("content") %>

(HTML footer)


This way you can alter the template page to your heart's content and
never have to worry about recompiling the body pages. You can even have
multiple templates for each body page (for example if you want to have
a printer friendly version of a page without the navigation). 

-August


--- Nick Wesselman <nick@digivis.com> wrote:
> >
> >
> >As I mentioned before, GNUJSP keeps a
> >record of what files include what, and if told to, recompiles all
> >including files when an included file changes.  
> >
> I don't recall gnujsp doing this--I've always had to touch files when
> I 
> change an included file with gnujsp as well.
> 
> Nick
> 
> 
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message