Mr Wiles the master guru of note! Long time…

 

Jip just a posting error my code ref is correct thanks

 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Wiles
Sent: Friday, January 06, 2006 12:21 PM
To: [email protected]
Subject: [CTJUG Forum] Re: Struts and tiles

 

Forgive me if I’m stating the obvious and it might just be an error in your post…

 

You’ve named the main template file “masterLayout.jsp” and then reference it in your actual page as masterTemplate.jsp”.

 

 


From: Leon van der Merwe [mailto:[EMAIL PROTECTED]
Sent: 06 January 2006 11:50 AM
To: [email protected]
Subject: [CTJUG Forum] Struts and tiles

 

I am trying to get tiles working in struts.

 

I have added the uri to web.xml:

 

<taglib>

    <taglib-uri>/tags/struts-tiles</taglib-uri>

    <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>

  </taglib>

 

then added it to struts-config.xml:

 

<plug-in className="org.apache.struts.tiles.TilesPlugin" >

 

      <!-- Path to XML definition file -->

      <set-property property="definitions-config"

                       value="/WEB-INF/tiles-defs.xml" />

      <set-property property="definitions-parser-validate"

                       value="true" />                  

      <!-- Set Module-awareness to true -->

      <set-property property="moduleAware" value="true" />

    </plug-in>

 

 

created a masterLayout.jsp

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

 

<html>

    <head>

        <title>

            <tiles:getAsString name="title"/>

        </title>

    </head>

    <body>

        <p>

        <tiles:insert attribute="header" />

        <tiles:insert attribute="content" />

        <tiles:insert attribute="footer" />

    </body>

</html>

 

 

created each tile(jsp):

header.jsp

<%@ page language="java" %>

<%@ taglib uri="/tags/struts-bean" prefix="bean" %>

<%@ taglib uri="/tags/struts-html" prefix="html" %>

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>

 

<table border="1">

            <tr>     

                        <td>

                                    This is my header

                        </td>

            </tr>

</table>

 

content.jsp

<%@ page language="java" %>

<%@ taglib uri="/tags/struts-bean" prefix="bean" %>

<%@ taglib uri="/tags/struts-html" prefix="html" %>

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>

 

<table border="1">

            <tr>     

                        <td>

                                    This is my content

                        </td>

            </tr>

</table>

 

footer.jsp:

<%@ page language="java" %>

<%@ taglib uri="/tags/struts-bean" prefix="bean" %>

<%@ taglib uri="/tags/struts-html" prefix="html" %>

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>

 

<table border="1">

            <tr>     

                        <td>

                                    This is my footer

                        </td>

            </tr>

</table>

 

then my actual page:

<%@ page language="java" %>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>

 

<tiles:insert page="/WEB-INF/pages/masterTemplate.jsp" flush="true" >

    <tiles:put name="title" value="Login Page" />

    <tiles:put name="header" value="/WEB-INF/pages/header.jsp" />

    <tiles:put name="content" value="/WEB-INF/pages/content.jsp" />

    <tiles:put name="footer" value="/WEB-INF/pages/footer.jsp" />

</tiles:insert>

 

 

I haven’t declared any definitions yet cause just want to get it working first.

 

Getting no errors and just a blank page…

 

Leon van der Merwe

Programmer

Bytes Specialised Solutions

 


Tel : (+27) (21) 590-9801
Fax : (+27) (21) 590-9999

Email :
[EMAIL PROTECTED]
Web : www.btgroup.co.za
Press Office : www.itweb.co.za/office/bytes

A division of Bytes Technology Group SA (Pty) Ltd : Registration No: 2003/027603/07
A member of Bytes Technology Group Ltd; In association with KAGISO
P O Box 13287, N1 City, 7463; Akker Park, Neels Bothma Street, N1 City, 7463, Cape Town, South Africa

E-Mail Disclaimer: http://www.altron.co.za/email.asp or phone: (+27) (11) 645-3600

 

Reply via email to