The Reason my page was displaying as black was because of an error in my header.jsp
when it used the tiles:getAsString tag to ask for the title attribute.
The example I was following seemed to imply that the title attribute in the definition
would be available to all
my tiles. This was not the case.
Instead I had to do the following in my layout jsp
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<%-- Added this bit --%>
<tiles:insert attribute="header">
<%-- this attribute is accessible from header.jsp --%>
<tiles:put name="title" beanName="title" beanScope="tile" />
</tiles:insert>
<%-- <tiles:get name="header" /> --%>
<tiles:get name="body"/>
<tiles:get name="footer"/>
I would like to know if this is definitely the way I should be doing this
or does it look like I am working round some other problem?
>>> [EMAIL PROTECTED] 02/18/04 02:18p.m. >>>
One cause of the blank page is if the attribute named in yout <tiles:insert>
(or <tiles:get> I guess) is/are named incorectly. Tiles seems quite happy
and carries on, just outputting nothing if these aren't found.
Niall
----- Original Message -----
From: "Nic Waight" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 18, 2004 1:11 AM
Subject: Re: Using Tile xml definition as an ActionForward
Spot on Niall,
My tiles-defs.xml was looking for /tiles/layout/Base.jsp
but the directory was layouts.
Now I am getting a blank page but I am making progress now.
I know iyt must be something small.
Thanks
for your help
Nic.
>>> [EMAIL PROTECTED] 02/18/04 01:58p.m. >>>
Actually your right, wasn't a clever suggestion - I hadn't used the
<tiles:get>, but looking at the source code - its identical to
<tiles:insert> and was put there so tiles was compatible with the original
struts template tags.
I didn't realize you were getting a 404 - I thought from your message you
were just getting a blank page in your browser. What is it telling you is
missing in the 404 - is it the layout "/tiles/layout/Base.jsp"? If so, I
know its obvious - but it is named correctly and deployed to the right
place?
I'm not familar with "Struts in Action" but there is a
tiles-documentation.war shipped with strust which you can drop into your
webapps folder.
Niall
----- Original Message -----
From: "Nic Waight" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 17, 2004 11:29 PM
Subject: Re: Using Tile xml definition as an ActionForward
I gave that a go but with the same result the browser displays a 404 not
found error.
Also I have been following the example in the Struts in Action book which
says to use the tiles:get tags in the layout.
Nic.
>>> [EMAIL PROTECTED] 02/18/04 12:14p.m. >>>
Try changing your layout ("/tiles/layout/Base.jsp") to
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<tiles:getAsString name="title"/>
<tiles:insert attribute="header"/>
<tiles:insert attribute="body"/>
<tiles:insert attribute="footer"/>
Niall
----- Original Message -----
From: "Nic Waight" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 17, 2004 9:57 PM
Subject: Using Tile xml definition as an ActionForward
I am new to using tiles and I am having a problem getting my definition
defined in my
tiles-defs.xml file to be displayed.
I have used the debugger to verify that the definition is being loaded when
I access the action but
the page is not displaying. I have checked the log and I am not getting any
errors.
I am using Struts 1.1 on Weblogic Server 8.1
my tiles-defs.xml looks like this
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles
Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<definition name=".css.main" path="/tiles/layout/Base.jsp">
<put name="title" value="Privacy Office" />
<put name="header" value="/tiles/header.jsp" />
<put name="body" value="/tiles/main.jsp" />
<put name="footer" value="/tiles/footer.jsp" />
</definition>
</tiles-definitions>
my layout jsp is
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<tiles:useAttribute name="title"/>
<tiles:get page="header"/>
<tiles:get page="body"/>
<tiles:get page="footer"/>
my action in my struts-config.xml looks like
<action path="/showMain" type="nz.govt.justice.css.ShowMainAction"
name="userData" scope="request" unknown="false" validate="false">
<forward name="success" path=".css.main" redirect="false"/>
</action>
and my plugin config looks like
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml"/>
<set-property property="definitions-debug" value="2"/>
<set-property property="definitions-parser-details" value="0"/>
<set-property property="definitions-parser-validate" value="true"/>
</plug-in>
Any help would be appreciated.
Thanks
Nic.
============================================================================
========
This e-mail message and attachments do not necessarily reflect the views of
the New Zealand Ministry of Justice and may contain
information that is confidential and may be subject to legal privilege. If
you
are not the intended recipient, you are hereby notified that you must not
use,
disseminate, distribute or copy this e-mail message or its attachments. If
you
received this message in error, please notify the Ministry of Justice
by telephone (call collect: 00-64-4-918-8800) or return the
original message to us by e-mail, and destroy any copies.
Thank you.
============================================================================
========
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
============================================================================
========
This e-mail message and attachments do not necessarily reflect the views of
the New Zealand Ministry of Justice and may contain
information that is confidential and may be subject to legal privilege. If
you
are not the intended recipient, you are hereby notified that you must not
use,
disseminate, distribute or copy this e-mail message or its attachments. If
you
received this message in error, please notify the Ministry of Justice
by telephone (call collect: 00-64-4-918-8800) or return the
original message to us by e-mail, and destroy any copies.
Thank you.
============================================================================
========
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
============================================================================
========
This e-mail message and attachments do not necessarily reflect the views of
the New Zealand Ministry of Justice and may contain
information that is confidential and may be subject to legal privilege. If
you
are not the intended recipient, you are hereby notified that you must not
use,
disseminate, distribute or copy this e-mail message or its attachments. If
you
received this message in error, please notify the Ministry of Justice
by telephone (call collect: 00-64-4-918-8800) or return the
original message to us by e-mail, and destroy any copies.
Thank you.
============================================================================
========
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
====================================================================================
This e-mail message and attachments do not necessarily reflect the views of
the New Zealand Ministry of Justice and may contain
information that is confidential and may be subject to legal privilege. If you
are not the intended recipient, you are hereby notified that you must not use,
disseminate, distribute or copy this e-mail message or its attachments. If you
received this message in error, please notify the Ministry of Justice
by telephone (call collect: 00-64-4-918-8800) or return the
original message to us by e-mail, and destroy any copies.
Thank you.
====================================================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]