Hi,
I have been having some issues with the evaluation of wild cards.
The key part of my tiles definition is as follows:
<definition name="app.*.*.*.*.*" extends="app.default">
<put-attribute name="title"
value="{1} --> {2} --> {3} --> {4} --> {5}" />
<put-attribute name="body"
value="/pages/{1}/{2}/{3}/{4}/{5}/index.jsp" />
</definition>
<definition name="app.*.*.*.*" extends="app.default">
<put-attribute name="title" value="{1} --> {2} --> {3} --> {4}"
/>
<put-attribute name="body"
value="/pages/{1}/{2}/{3}/{4}/index.jsp" />
</definition>
<definition name="app.*.*.*" extends="app.default">
<put-attribute name="title" value="{1} --> {2} --> {3}" />
<put-attribute name="body" value="/pages/{1}/{2}/{3}/index.jsp"
/>
</definition>
<definition name="app.*.*" extends="app.default">
<put-attribute name="title" value="{1} --> {2}" />
<put-attribute name="body" value="/pages/{1}/{2}/index.jsp" />
</definition>
<definition name="app.*" extends="app.default">
<put-attribute name="title" value="home --> {1}" />
<put-attribute name="body" value="/pages/{1}/index.jsp" />
</definition>
So basically, it splits the tiles path name up, and uses it to
determine the appropriate path for the page file. The value of
'title' has is basically being used for debug at the moment, as I will
shortly come to. There are other explicit definitions elsewhere.
So, ignoring the remapping stuff that would make this trick useful, if
I just type into the browser,
app.test.subtest.tiles
The title appears as
home --> test.subtest
I have tried altering the definition order, but this does not seem to
make a difference.
Annoyingly if I try:
app.test.subtest.foo.bar.tiles
I get:
test --> subtest --> foo --> bar
Which means the wildcards are handling the split correctly, in some
cases. It seems to be fine for all 4th level definitions.
And for
app.test.subtest.foo.bar.me.tiles
I get test --> subtest --> foo --> bar.me
So, in conclusion, the definitions work for 1st level path, 4th level
path. They half work for the 5th level path, and don't work at all
for 2nd and 3rd.
Any ideas? Maybe this feature would be a lot more useful if it worked
with regular expressions. Maybe something for 2.2?