You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2007/06/15 15:38:44 UTC
svn commit: r547680 - /tiles/site/src/site/apt/tutorial/configuration.apt
Author: apetrelli
Date: Fri Jun 15 06:38:43 2007
New Revision: 547680
URL: http://svn.apache.org/viewvc?view=rev&rev=547680
Log:
Updated configuration tutorial page.
Modified:
tiles/site/src/site/apt/tutorial/configuration.apt
Modified: tiles/site/src/site/apt/tutorial/configuration.apt
URL: http://svn.apache.org/viewvc/tiles/site/src/site/apt/tutorial/configuration.apt?view=diff&rev=547680&r1=547679&r2=547680
==============================================================================
--- tiles/site/src/site/apt/tutorial/configuration.apt (original)
+++ tiles/site/src/site/apt/tutorial/configuration.apt Fri Jun 15 06:38:43 2007
@@ -34,48 +34,79 @@
* Starting Tiles engine
- To start Tiles in a web application you can:
+ To start Tiles you have three options, just choose what is the best for your
+ needs:
- * Load the Tiles servlet at startup. You can do it by specifying it in your
- <<<web.xml>>> file:
+ * Load the <<Tiles servlet>> at startup. You can do it by specifying it in
+ your <<<web.xml>>> file:
--------------------------
<servlet>
<servlet-name>tiles</servlet-name>
- <servlet-class>org.apache.tiles.servlet.TilesServlet</servlet-class>
+ <servlet-class>oorg.apache.tiles.web.startup.TilesServlet</servlet-class>
<init-param>
- <param-name>org.apache.tiles.DEFINITIONS_CONFIG</param-name>
- <param-value>/WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml</param-value>
+ <param-name>
+ org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
+ </param-name>
+ <param-value>
+ /WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml
+ </param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
--------------------------
- As you can see, the init parameter <<<org.apache.tiles.DEFINITIONS_CONFIG>>>
+ As you can see, the init parameter
+ <<<org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG>>>
specifies the path of the {{{basic/index.html}Tiles configuration files}}.
You can specify it also as a context parameters.
- * Load the Tiles listener. Specify it in your <<<web.xml>>> file:
+ Note: The Tiles servlet is just a startup servlet and <<it does not serve any
+ request>>. Therefore, a mapping is not needed.
+
+ * Load the <<Tiles listener>>. Specify it in your <<<web.xml>>> file:
-------------------------------
<listener>
- <listener-class>org.apache.tiles.listener.TilesListener</listener-class>
+ <listener-class>org.apache.tiles.web.startup.TilesListener</listener-class>
</listener>
-------------------------------
You can specify the Tiles configuration files using a context parameter.
+
+-------------------------------
+ <context-param>
+ <param-name>
+ org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
+ </param-name>
+ <param-value>
+ /WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml
+ </param-value>
+ </context-param>
+-------------------------------
- * Load the Tiles filter.
+ * Load the <<Tiles filter>>. It is useful if your definition files can be
+ changed and you periodically need to reload them.
------------------------------
<filter>
<filter-name>Tiles Filter</filter-name>
- <filter-class>org.apache.tiles.filter.TilesFilter</filter-class>
+ <filter-class>org.apache.tiles.web.startup.TilesFilter</filter-class>
<init-param>
- <param-name>org.apache.tiles.DEFINITIONS_CONFIG</param-name>
- <param-value>/WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml</param-value>
+ <param-name>
+ org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
+ </param-name>
+ <param-value>
+ /WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml
+ </param-value>
</init-param>
</filter>
+...
+<filter-mapping>
+ <filter-name>Tiles Filter</filter-name>
+ <url-pattern>*</url-pattern>
+ <dispatcher>REQUEST</dispatcher>
+</filter-mapping>
--------------------------------
Starting Tiles in a portlet application