cedric 2002/07/17 02:23:50
Modified: doc/userGuide dev_tiles.xml
Log:
Update "how to enable Tiles"
Revision Changes Path
1.5 +154 -106 jakarta-struts/doc/userGuide/dev_tiles.xml
Index: dev_tiles.xml
===================================================================
RCS file: /home/cvs/jakarta-struts/doc/userGuide/dev_tiles.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dev_tiles.xml 7 Jul 2002 22:03:00 -0000 1.4
+++ dev_tiles.xml 17 Jul 2002 09:23:50 -0000 1.5
@@ -1,204 +1,252 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<document url="./resources.xml">
-<properties>
-<author>Ted Husted</author>
-<author>Cedric Dumoulin</author>
-<title>The Struts User's Guide - Tiles Guide</title>
-</properties>
-<body>
-<chapter name="Tiles Guide">
-
-<section href="tiles" name="The Tiles Document Assembly Framework">
-
-<p>Tiles builds on the "include" feature provided by the JavaServer Page
-specification to provided a full-featured, robost framework for assembling
+ <properties>
+ <author>Ted Husted</author>
+ <author>Cedric Dumoulin</author>
+ <title>The Struts User's Guide - Tiles Guide</title>
+ </properties>
+ <body>
+ <chapter name="Tiles Guide">
+ <section href="tiles" name="The Tiles Document Assembly
Framework">
+ <p>Tiles builds on the "include" feature provided by
the JavaServer Page
+specification to provided a full-featured, robust framework for assembling
presentation pages from component parts. Each part, or tile, can be
reused as often as needed throughout your application. This reduces the
amount of markup that needs to be maintained and makes it easier to
change the look and feel of a website. </p>
-
-</section>
-
-<section href="features" name="Overview of Tiles Features">
-
- <ul>
- <li>
+ </section>
+ <section href="features" name="Overview of Tiles Features">
+ <ul>
+ <li>
Screen definitions
<ul>
- <li>
+ <li>
Create a screen by assembling
- <strong><em>Tiles</em></strong> : header, footer,
+ <strong>
+ <em>Tiles</em>
+ </strong> : header,
footer,
menu, body
</li>
- <li>
+ <li>
Definitions can take place :
<ul>
- <li>
+ <li>
in a centralized xml
file
</li>
- <li>
+ <li>
directly in jsp page
</li>
- <li>
+ <li>
in struts action
</li>
- </ul>
- </li>
- <li>
+ </ul>
+ </li>
+ <li>
Definitions provide an inheritance
mechanism : a definition can extends another one,
and override parameters.
</li>
- </ul>
- </li>
- <li>
+ </ul>
+ </li>
+ <li>
Templating
<ul>
- <li>
- <strong><em>Tiles</em></strong>
+ <li>
+ <strong>
+ <em>Tiles</em>
+ </strong>
framework is entirely compatible with
<em>Templates</em> defined by David Geary and
implemented in Struts
</li>
- <li>
+ <li>
You can replace <em>Templates</em>
- library by <strong><em>Tiles</em></strong>
+ library by <strong>
+ <em>Tiles</em>
+ </strong>
one
</li>
- </ul>
- </li>
- <li>
+ </ul>
+ </li>
+ <li>
Layouts
<ul>
- <li>
+ <li>
Define common page layouts and reuse
them across your web site
</li>
- <li>
+ <li>
Define menu layouts, and use them by
passing lists of items and links
</li>
- <li>
+ <li>
Define portal layout, use it by
- passing list of <strong><em>Tiles</em></strong>
+ passing list of <strong>
+ <em>Tiles</em>
+ </strong>
(pages) to show
</li>
- <li>
+ <li>
Reuse existing layouts, or define
your owns
</li>
- </ul>
- </li>
- <li>
+ </ul>
+ </li>
+ <li>
Dynamic page building
<ul>
- <li>
+ <li>
Tiles are gather dynamically during
page reload. It is possible to change any attributes
: layout, list of Tiles in portal, list of menu
items, ...
</li>
- </ul>
- </li>
- <li>
- Reuse of <strong><em>Tiles</em></strong> /
+ </ul>
+ </li>
+ <li>
+ Reuse of <strong>
+ <em>Tiles</em>
+ </strong> /
Components
<ul>
- <li>
+ <li>
If well defined, a
- <strong><em>Tile</em></strong> can be reused in
+ <strong>
+ <em>Tile</em>
+ </strong> can be
reused in
different location
</li>
- <li>
+ <li>
Dynamic attributes are used to
- parameterized <em><strong>Tiles</strong></em>
- </li>
- <li>
+ parameterized <em>
+
<strong>Tiles</strong>
+ </em>
+ </li>
+ <li>
It is possible to define library of
- reusable <em><strong>Tiles</strong></em>.
+ reusable <em>
+
<strong>Tiles</strong>
+ </em>.
</li>
- <li>
+ <li>
Build a page by assembling predefined
components, give them appropriate parameters
</li>
- </ul>
- </li>
- <li>
+ </ul>
+ </li>
+ <li>
Internationalization (i18n)
</li>
- <ul>
- <li>
+ <ul>
+ <li>
It is possible to load different tiles
according to Locale
</li>
- <li>
+ <li>
A mechanism similar to Java properties
files is used for definitions files : you can have one
definition file per Locale. The appropriate definition is
loaded according to current Locale
</li>
- </ul>
- <li>
+ </ul>
+ <li>
Multi-channels
</li>
- <ul>
- <li>
+ <ul>
+ <li>
It is possible to load different Tiles
according to a key stored in jsp session, or
anywhere.
</li>
-
- <li>
+ <li>
For example, key could be user provilege,
browser type, ...
</li>
-
- <li>
+ <li>
A mechanism similar to Java properties
files is used for definitions files : you can have one
definition file per key. The appropriate definition is
loaded according to the key.
</li>
- </ul></ul>
-</section>
-
-<section href="setup" name="Enabling your application for Tiles">
-
-<p>The Tiles framework is bundled with Struts. It is not enabled by default.
+ </ul>
+ </ul>
+ </section>
+ <section href="setup" name="Enabling your application for
Tiles">
+ <p>The Tiles framework is bundled with Struts. It is
not enabled by default.
To enable Tiles you need to:
</p>
-
-<ul>
-<li>Setup the struts-tiles taglib in your web.xml</li>
-<li>Add the Tiles Request controller to your struts-config.xml</li>
-</ul>
-
-<p>[:TODO: additional detail.]</p>
-
-</section>
-
-<section href="tiles" name="Tiles API Guide">
-
-<p>
+ <ul>
+ <li>Setup the struts-tiles taglib in your
<code>WEB-INF/web.xml</code>
+ file to include the following tag library declarations:</li>
+ </ul>
+ <pre><taglib>
+ <taglib-uri>/WEB-INF/tiles.tld</taglib-uri>
+ <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
+</taglib>
+</pre>
+ <ul>
+ <li>At the top of each JSP page that will use
the Tiles custom tags,
+ add line(s) declaring the Tiles custom tag libraries used on
+ this particular page, like this:</li>
+ </ul>
+ <pre><%@ taglib uri="/WEB-INF/struts-tiles.tld"
prefix="tiles" %>
+</pre>
+ <ul>
+ <li>If you plan to use Tiles definitions
defined in a centralized file, you need
+ to create this file, and instruct Struts to load the plugin which will
create
+ the factory corresponding to the file. You can have more than one
definitions
+ files.</li>
+ <ul>
+ <li>Create a file containing your
definitions and give it a name (ex :
+ <code>WEB-INF/tiles-defs.xml</code>). You can use the
<code>tiles-defs.xml</code>
+ file from the Tiles application for a detailed example of the required
syntax.</li>
+ <li>Setup Tiles plugin in each
<code>struts-config.xml</code> file corresponding to
+ a module:</li>
+ </ul>
+ <pre>
+ <plug-in className="org.apache.struts.tiles.TilesPlugin" >
+ <set-property property="definitions-config"
+ value="/WEB-INF/tiles-defs.xml,
+ /WEB-INF/tiles-tests-defs.xml" />
+ <set-property property="definitions-debug" value="0" />
+ <set-property property="definitions-parser-details" value="0" />
+ <set-property property="definitions-parser-validate" value="true" />
+ </plug-in>
+</pre>
+ <ul>
+ <li>
+ <strong>note:</strong> This
plugin creates one single shared factory even if you have
+ several modules. The plugin first read factory parameters from
<code>web.xml</code> and
+ then overload them with parameters from the first
<code>struts-config.xml</code> file read.
+ Read order is determined by the order of module declarations in
<code>web.xml</code>.</li>
+ </ul>
+ </ul>
+ </section>
+ <section href="tiles" name="Tiles API Guide">
+ <p>
A concise
<a
href="http://jakarta.apache.org/struts/api/org/apache/struts/taglib/tiles/package-summary.html">Tiles
API Guide</a> is available to help you get started
with the Tiles framework. [:TODO: change link to #package_description when
available.]
</p>
-
-</section>
-
-<section href="resources" name="Tiles Resources">
-
-<p><a
href="http://www-106.ibm.com/developerworks/java/library/j-strutstiles.html?loc=j"><b>Struts
and Tiles aid component-based development</b></a> by Wellie Chao.</p>
-
-<p><a
href="http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html"><b>UI
design with Tiles and Struts</b></a> by Prakash Malani.</p>
-
-<p><b><u>Developing applications with Tiles</u></b> by Cedric Dumoulin and Ted
Husted.
+ </section>
+ <section href="resources" name="Tiles Resources">
+ <p>
+ <a
href="http://www-106.ibm.com/developerworks/java/library/j-strutstiles.html?loc=j">
+ <b>Struts and Tiles aid
component-based development</b>
+ </a> by Wellie Chao.</p>
+ <p>
+ <a
href="http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html">
+ <b>UI design with Tiles and Struts</b>
+ </a> by Prakash Malani.</p>
+ <p>
+ <b>
+ <u>Developing applications with
Tiles</u>
+ </b> by Cedric Dumoulin and Ted Husted.
Sample chapter from <u>Java Web Development with Struts</u>; available as a
<u>free download</u> (PDF).
</p>
-
-</section>
-
-</chapter></body></document>
+ </section>
+ </chapter>
+ </body>
+</document>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>