I may not have quite understood your structure but it seems strange to be
creating all those separate directories when it's only the body include that
is changing for each link. It looks like you should be using a servlet to
detect which link has been requested (via the querystring perhaps) and then
creating each page dynamiclly. The same could be done in a JSP if you
prefer with a switch statement or a set of if/else statements leading to the
different includes
ie:
index.jsp
---------
<%@ include file="/Global/Banner.jsp" %>
<table>
<tr>
<td><%@ include file="/Global/Menu.jsp" %></td>
<td>
<%
if (request.getParameter("linkName") == "blah"){
//include the blah body text
}else if (request.getParameter("linkName") == "blob"){
//include the blob body texyt
}else{
//include the default body text
}
%>
</td>
</tr>
</table>
<%@ include file="/Global/Footer.jsp" %>
That would mean that essentially all you'd be editing would ever be the body
includes.
Tref Gare
Web Developer MCSD/SCJP
eCommerce Group
Phone: (03) 9221 4106
Mobile: 0409 556 478
Fax: (03) 9941 4295
> -----Original Message-----
> From: Soefara Redzuan [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday,27 February 2002 5:39
> To: [EMAIL PROTECTED]
> Subject: Better way to build a site than or with JSPs ?
>
> I've experimented and have found one way to templated site with JSP but
> there has to be a better way. First, I'll explain what I do at the moment.
> Consider a very simplistical sitemap ~
>
> Homepage
> +-Company
> +-Products
> +-Services
> +-Feedback
>
> I've created a folder structure to represent this. And the default page in
> each folder is index.jsp. Each page (index.jsp) shares the same banner
> (Banner.jsp), footer (Footer.jsp) and navigation menu (Menu.jsp) which go
> in
> the Global folder. So, this gives me the following ~
>
> index.jsp (Homepage)
> \Company\index.jsp
> \Products\index.jsp
> \Services\index.jsp
> \Feedback\index.jsp
> \Global\Banner.jsp
> \Menu.jsp
> \Footer.jsp
>
> So far, so good. Next, to make it easier to edit the content on each page
> and to make it easier to have uniform consistency of pages, EVERY
> index.jsp
> is IDENTICAL ~
>
> index.jsp
> ---------
> <%@ include file="/Global/Banner.jsp" %>
> <table>
> <tr>
> <td><%@ include file="/Global/Menu.jsp" %></td>
> <td><%@ include file="body.jsp" %></td>
> </tr>
> </table>
> <%@ include file="/Global/Footer.jsp" %>
>
>
> Using this, the final file structure is ~
>
> index.jsp (Homepage)
> body.jsp
> \Company\index.jsp
> \body.jsp
> \Products\index.jsp
> \body.jsp
> \Services\index.jsp
> \body.jsp
> \Feedback\index.jsp
> \body.jsp
> \Global\Banner.jsp
> \Menu.jsp
> \Footer.jsp
>
>
> And you know, this system works for me. To edit any page, all I have to
> do
> it edit the body.jsp which means that I have little risk of messing up the
> template.
>
> The problem with this is obviously all those identical index.jsp's !! If I
> have to make a change to the layout, then I have to change all of them.
> That's obviously BAD but is a simple search/replace because they're all
> identical anyway.
>
> I know I can use Velocity within JSP in order to use one template for all
> the JSPs but I still end up with literally hundreds of identical index.jsp
> pages for a real site with many levels of subdirectories. It'll be easier
> to
> change the template for layout but really whenever I see repetition on the
> scale of all those index.jsp's I think something's inefficient.
>
> There has to be a better way of doing this, is there ?
>
> Soefara.
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://archives.java.sun.com/jsp-interest.html
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.jsp
> http://www.jguru.com/faq/index.jsp
> http://www.jspinsider.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com