Skip to content

Commit

Permalink
further improvements from Michael Isvy, use tiles-3* dependencies in …
Browse files Browse the repository at this point in the history
…the example.

git-svn-id: https://svn.apache.org/repos/asf/tiles/framework/trunk@1427704 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
michaelsembwever committed Jan 2, 2013
1 parent d8d4aa6 commit 2720827
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/site/apt/tutorial/advanced/wildcard.apt
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,31 @@ Wildcard support
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-extras</artifactId>
<version>2.2.2</version>
<version>3.0.1</version>
</dependency>
------------------------------------

If you are using Spring, you should add the 'completeAutoload' attribute to your TilesConfigurer bean.

------------------------------------
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
<property name="completeAutoload" value="true"/>
</bean>
------------------------------------

** Using prefixes for wildcards and Regular Expressions
** Using prefixes

Here is an example of prefix using Regular Expressions:

When using completeAutoload, you can use wildcard expressions and/or regexp. Each of them should be enabled using the dedicated prefix as follows.
------------------------------------
<definition name="REGEXP:test\.definition(.*)\.message(.*)" template="/layout{1}.jsp">
<put-attribute name="title" value="This definition has a message: {2}."/>
<put-attribute name="header" value="/header.jsp"/>
<put-attribute name="body" value="/body.jsp"/>
</definition>
------------------------------------

*** WILDCARD
The below sample uses WILDCARD (this prefix is not needed when using wildcards solely, as shown in the 'Default Configuration' section).

------------------------------------
<definition name="WILDCARD:test.definition*.message*" template="/layout{1}.jsp">
Expand All @@ -141,18 +148,8 @@ Wildcard support
</definition>
------------------------------------

And, if you want to use Regular Expressions:

*** REGEXP

------------------------------------
<definition name="REGEXP:test\.definition(.*)\.message(.*)" template="/layout{1}.jsp">
<put-attribute name="title" value="This definition has a message: {2}."/>
<put-attribute name="header" value="/header.jsp"/>
<put-attribute name="body" value="/body.jsp"/>
</definition>
------------------------------------
*** tiles:insertDefinition
* tiles:insertDefinition

In both cases, if you insert a definition that matches the definition, for example:

Expand Down

0 comments on commit 2720827

Please sign in to comment.