My 2c... If you are only going to *ever* have a few jsp pages, say 5 or less, then it seems fine to me. However beyond that I think it will quickly become unweildy.
I don't know if you are interested in following the MVC architecture, and certainly for only a few pages it is not worth it, but if you are then it seems to me that there is some conflict since the 'template' page will be doing some (but not all) of both the View and the Controler portions of the architecture. Cheers Adrian > -----Original Message----- > From: Joel Carklin [SMTP:[EMAIL PROTECTED]] > Sent: 10 January 2003 09:39 > To: [EMAIL PROTECTED] > Subject: advice on jsp include > > Hi all, > > I have a web app in which all the pages have exactly the same header, > side bar and footer. At first I was going to make these 3 seperate jsp > files and use a jsp include, (probably the <%@ include %> since the > pages won't change?). > > Then the web designer returned a 'template' to me which had all 3 on one > page, laid out, with an area, a table cell which contains the actual > difference for each page, the idea being that if I have 10 different > pages I can make 10 copies of the template and just fill in the table > cell. So then I thought, what about just having the one 'template' page > which all the webapp links reference, and include the portion that > changes, using the include statement and using a request attribute to > tell the page what to include. For example like this: > > <c:choose> > <c:when test="${showPage=='Page1'}"> > <jsp:include flush="true" page="_page1.jsp"/> > </c:when> > <c:when test="${showPage=='Page2'}"> > <jsp:include flush="true" page="_page2.jsp"/> > </c:when> > <c:when test="${showPage=='etc'}"> > <jsp:include flush="true" page="_etc.jsp"/> > </c:when> > <c:otherwise> > <jsp:include flush="true" page="_login.jsp"/> > </c:otherwise> > </c:choose> > > I hope I being clear. > > I guess what I'm asking is the pro's cons of such a setup. I haven't > really seen anyone else doing it and am wondering if this is because it > increases compilation time significantly or something else I don't know > about. Is there a better way to do it? > > Any comments / criticisms appreciated > > Thanks > Joel > > ========================================================================== > = > 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 -- It is the strict policy of Truworths that its e-mail facility and all e-mail communications emanating therefrom, should be utilised for business purposes only and should conform to high professional and business standards. Truworths has stipulated certain regulations in terms whereof strict guidelines relating to the use and content of e-mail communications are laid down. The use of the Truworths e-mail facility is not permitted for the distribution of chain letters or offensive mail of any nature whatsoever. Truworths hereby distances itself from and accepts no liability in respect of the unauthorised use of its e-mail facility or the sending of e-mail communications for other than strictly business purposes. Truworths furthermore disclaims liability for any unauthorised instruction for which permission was not granted. Truworths Limited accepts no liability for any consequences arising from or as a result of reliance on this message unless it is in respect of bona fide Truworths business for which proper authorisation has been granted. Any recipient of an unacceptable communication, a chain letter or offensive material of any nature is requested to notify the Truworths e-mail administrator ([EMAIL PROTECTED]) immediately in order that appropriate action can be taken against the individual concerned. =========================================================================== 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