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 2008/10/02 12:29:29 UTC
svn commit: r701068 - in /tiles/framework/trunk/src/site:
apt/config-reference.apt apt/tutorial/advanced/index.apt
apt/tutorial/advanced/multiple-containers.apt apt/tutorial/index.apt
apt/whats-new.apt site.xml
Author: apetrelli
Date: Thu Oct 2 03:29:28 2008
New Revision: 701068
URL: http://svn.apache.org/viewvc?rev=701068&view=rev
Log:
TILES-310
Documented usage of multiple containers.
Added:
tiles/framework/trunk/src/site/apt/tutorial/advanced/multiple-containers.apt
Modified:
tiles/framework/trunk/src/site/apt/config-reference.apt
tiles/framework/trunk/src/site/apt/tutorial/advanced/index.apt
tiles/framework/trunk/src/site/apt/tutorial/index.apt
tiles/framework/trunk/src/site/apt/whats-new.apt
tiles/framework/trunk/src/site/site.xml
Modified: tiles/framework/trunk/src/site/apt/config-reference.apt
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/config-reference.apt?rev=701068&r1=701067&r2=701068&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/apt/config-reference.apt (original)
+++ tiles/framework/trunk/src/site/apt/config-reference.apt Thu Oct 2 03:29:28 2008
@@ -75,6 +75,12 @@
| {{{config-reference.html#org.apache.tiles.locale.LocaleResolver}<<<org.apache.tiles.locale.LocaleResolver>>>}} | Locale resolver class name |
*---------------------------------------------+--------------------------------------+
+ [[5]] {{{config-reference.html#TilesListener_configuration}<<<TilesListener>>> configuration}}.
+
+*---------------------------------------------+--------------------------------------+
+| {{{config-reference.html#org.apache.tiles.web.startup.TilesListener.CONTAINER_KEY}<<<org.apache.tiles.web.startup.TilesListener.CONTAINER_KEY>>>}} | Container key |
+*---------------------------------------------+--------------------------------------+
+
* Extended configuration
[[1]] {{{config-reference.html#KeyedDefinitionsFactoryTilesContainerFactory_configuration}<<<KeyedDefinitionsFactoryTilesContainerFactory>>> configuration}}.
@@ -280,6 +286,20 @@
* <<Usage>>: when specified, it must contain the name of a class implementing
{{{apidocs/org/apache/tiles/locale/LocaleResolver.html}<<<LocaleResolver>>>}}.
+* {<<<TilesListener>>> configuration}
+
+** {<<<org.apache.tiles.web.startup.TilesListener.CONTAINER_KEY>>>}
+
+ Specifies the key under which the Tiles container will be stored.
+
+ * <<Specified in>>:
+ {{{apidocs/org/apache/tiles/web/startup/TilesListener.html#CONTAINER_KEY_INIT_PARAMETER}<<<org.apache.tiles.web.startup.TilesListener>>>}}.
+
+ * <<Default>>: <<<null>>> (default container)
+
+ * <<Usage>>: when specified, it must contain the key under which the container
+ will be stored.
+
Extended configuration parameters
* {<<<KeyedDefinitionsFactoryTilesContainerFactory>>> configuration}
Modified: tiles/framework/trunk/src/site/apt/tutorial/advanced/index.apt
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/tutorial/advanced/index.apt?rev=701068&r1=701067&r2=701068&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/apt/tutorial/advanced/index.apt (original)
+++ tiles/framework/trunk/src/site/apt/tutorial/advanced/index.apt Thu Oct 2 03:29:28 2008
@@ -48,3 +48,5 @@
[[10]] {{{el-support.html}EL support}}
[[11]] {{{attribute-rendering.html}Attribute rendering}}
+
+ [[12]] {{{multiple-containers.html}Using multiple containers}}
Added: tiles/framework/trunk/src/site/apt/tutorial/advanced/multiple-containers.apt
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/tutorial/advanced/multiple-containers.apt?rev=701068&view=auto
==============================================================================
--- tiles/framework/trunk/src/site/apt/tutorial/advanced/multiple-containers.apt (added)
+++ tiles/framework/trunk/src/site/apt/tutorial/advanced/multiple-containers.apt Thu Oct 2 03:29:28 2008
@@ -0,0 +1,72 @@
+~~ $Id: list-attributes.apt 700538 2008-09-30 18:08:44Z apetrelli $
+~~
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+~~
+ -----------
+ Using multiple containers
+ -----------
+
+Defining multiple containers
+
+ With Tiles 2.1 it is possible to use more that one Tiles container in your
+ application.
+
+* Configuration
+
+ To use an alternate container, it must be configured through the use of the
+ {{{../../config-reference.html#org.apache.tiles.web.startup.TilesListener.CONTAINER_KEY}org.apache.tiles.web.startup.TilesListener.CONTAINER_KEY}}
+ initialization parameter. For example:
+
+------------------------------------
+<servlet>
+ <servlet-name>tiles-alt</servlet-name>
+ <servlet-class>org.apache.tiles.web.startup.TilesServlet</servlet-class>
+ <init-param>
+ <param-name>org.apache.tiles.web.startup.TilesListener.CONTAINER_KEY</param-name>
+ <param-value>alternate</param-value>
+ </init-param>
+</servlet>
+------------------------------------
+
+Selecting one non-default container
+
+ Once defined, it is possible to select a non-default container through Java
+ or JSP
+
+* Selection through Java
+
+ It is possible to use, for the current request, a different container
+ stored under another key, by using
+ {{{../../apidocs/org/apache/tiles/servlet/context/ServletUtil.html#setCurrentContainer(javax.servlet.ServletRequest,%20javax.servlet.ServletContext,%20org.apache.tiles.TilesContainer)}<<<setCurrentContainer>>>}}
+ method of ServletUtil class. For example:
+
+------------------------------------
+ServletUtil.setCurrentContainer(request, applicationContext, "myContainerKey");
+------------------------------------
+
+ If the last parameter is <<<null>>>, the default container is selected.
+
+* Selection through JSP
+
+ The current container can be selected also through the use of JSP:
+
+------------------------------------
+<tiles:setCurrentContainer containerKey="myContainerKey" />
+------------------------------------
+
+ If the <<<containerKey>>> attribute is not present, the default container is selected.
Modified: tiles/framework/trunk/src/site/apt/tutorial/index.apt
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/tutorial/index.apt?rev=701068&r1=701067&r2=701068&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/apt/tutorial/index.apt (original)
+++ tiles/framework/trunk/src/site/apt/tutorial/index.apt Thu Oct 2 03:29:28 2008
@@ -65,6 +65,8 @@
[[11]] {{{advanced/attribute-rendering.html}Attribute rendering}}
+ [[12]] {{{advanced/multiple-containers.html}Using multiple containers}}
+
[[7]] {{{integration/index.html}Integration with other technologies}}
[[1]] {{{integration/frameworks.html}Integration with other frameworks}}
Modified: tiles/framework/trunk/src/site/apt/whats-new.apt
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/whats-new.apt?rev=701068&r1=701067&r2=701068&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/apt/whats-new.apt (original)
+++ tiles/framework/trunk/src/site/apt/whats-new.apt Thu Oct 2 03:29:28 2008
@@ -64,6 +64,8 @@
* Customize {{{tutorial/advanced/attribute-rendering.html}rendering of attributes}},
for example to write integrations with other frameworks.
+ * Usage of {{{tutorial/advanced/multiple-containers.html}more than one Tiles container}}.
+
* Under the hood
* Tiles exceptions are all unchecked now: you can now remove all your
Modified: tiles/framework/trunk/src/site/site.xml
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/site.xml?rev=701068&r1=701067&r2=701068&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/site.xml (original)
+++ tiles/framework/trunk/src/site/site.xml Thu Oct 2 03:29:28 2008
@@ -119,6 +119,9 @@
<item
name="Attribute rendering"
href="tutorial/advanced/attribute-rendering.html"/>
+ <item
+ name="Multiple containers"
+ href="tutorial/advanced/multiple-containers.html"/>
</item>
<item
name="Integrations"