You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "David G. Friedman" <hu...@ix.netcom.com> on 2005/02/23 05:54:52 UTC

RE: Tiles - a reality check (contains many details) - Am Iusing this thing right?

Dave,

You can have one template contain the header, footer, title, body, etc.
components and simply set them to "" in templates that extend that
definition and which don't need to display various components.

Regards,
David

-----Original Message-----
From: Eric Lemle [mailto:eric.lemle@ihc.com]
Sent: Tuesday, February 22, 2005 3:58 PM
To: user@struts.apache.org
Subject: Re: Tiles - a reality check (contains many details) - Am Iusing
this thing right?


Did you create a template.jsp that inserts the header, footer, nav, and
main tile?


Eric D. Lemle
Senior Programmer / Analyst
Intermountain Health Care
36 South State Street, Suite 1100
Salt Lake City, Utah 84111
United States of America (USA)
(801) 442-3688 -- e-mail: Eric.Lemle@IHC.com


>>> chachany@gmail.com 2/22/2005 1:50:34 PM >>>
Hi all

I'm slowly figuring out the basics of Tiles, and I feel like its a
good solution for my application. I want to make sure before I get to
far that I'm thinking about things the right way.

I have

1. a login page with a header, body and footer

2. Application itself which will contain a Header, Navigation, Body
and Footer (same Header, and Footer as the login page).

I have created the following directory structure ans JSP layout under
my brand new shiny Struts 1.1 web application under the WebRoot
Directory

\WebRoot
\WebRoot\WEB-INF
\WebRoot\WEB-INF\tiles-defs.xml (listed below)
\WebRoot\jsp
\WebRoot\jsp\images
\WebRoot\jsp\layouts
\WebRoot\jsp\layouts\loginLayout.jsp
\WebRoot\jsp\layouts\siteLayout.jsp
\WebRoot\jsp\tiles
\WebRoot\jsp\tiles\header.jsp (not full html page)
\WebRoot\jsp\tiles\footer.jsp
\WebRoot\jsp\tiles\navigation.jsp
\WebRoot\jsp\loginBody.jsp
\WebRoot\jsp\appPageBody.jsp

Explanation:
\layouts contains my JSP Layouts for the different parts of the app
\tiles contains my reusable areas in the app (not complete html pages)
\jsp contains the different "body" jsp files

My question is : Is this a typical way to arrange a generic Tiles
application? the problem come in when I try to use definition
inheritance in the tiles-defs.xml file. See how in the tiles-defs.xml
I have page.AppStart inheriting from base.definition, but it's using a
DIFFERENT page as a template because the LOGIN page doesnt need
navigation and th application page does...

tiles-defs.xml
<tiles-definitions>
<!-- Base Tiles Definition -->
  <definition name="base.definition"
path="/jsp/layouts/loginLayout.jsp">
<put name="header" value="/jsp/tiles/header.jsp" />
<put name="footer" value="/jsp/tiles/footer.jsp" />
  </definition>

<!-- Tiles Definition of login page -->
  <definition name="page.login" extends="base.definition">
<put name="title" value="Login Page" />
<put name="body" value="/jsp/loginBody.jsp" />
  </definition>

<!-- Tiles definition of mail application page-->
  <definition name="page.appStart" extends="base.definition"
path="/jsp/layouts/siteLayout.jsp">
              <put name="title" value="Application Title" />
<put name="nav" value="/jsp/navigation.jsp" />
<put name="body" value="/jsp/appStartBody.jsp" />
  </definition>
</tiles-definitions>

--
-Dave
ChaChaNY@Gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org