|
My hotmail is [EMAIL PROTECTED]. On msn
K bai
-----Original Message-----
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]
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
A division of Bytes Technology Group SA (Pty) Ltd :
Registration No: 2003/027603/07 E-Mail Disclaimer: http://www.altron.co.za/email.asp or phone: (+27) (11) 645-3600
|
- [CTJUG Forum] Re: Struts and tiles Michael Wiles
- [CTJUG Forum] Re: Struts and tiles Leon van der Merwe
- [CTJUG Forum] Re: Struts and tiles Leon van der Merwe
- [CTJUG Forum] Re: Struts and tiles Leon van der Merwe
- [CTJUG Forum] Re: Struts and tiles Leon van der Merwe
- [CTJUG Forum] Re: Struts and tiles Leon van der Merwe
