Now, how about creating a page with the logical name secure/supersecure/
Enigma? Try it yourself, as an exercise. In fact, you can have the structure of
subdirectories as deep as you wish.
Now, let me show one tricky but clever feature of Tapestry 5. Let's create a page
named SecurePage, and put it into the existing secure subdirectory. Do everything
like you did with the Payment page; only the name of the page will be different.
Finally, use a PageLink on the Start page to link to the new page. How will you
configure it? Perhaps like this:
Go to the Secure Page
The Foundations of Tapestry
[ 72 ]
Now, run the application. What you will see is Tapestry's Exception page, as
glorious and informative as before:
This page is really helpful. It not only it tells us that there is no page named secure/
SecurePage, but it also provides a list of all the available page names. At the end of
this list, we shall find a page named secure/Page. You might be surprised to know
that this is exactly the page we have just created.
See, Tapestry makes an optimization when it selects a logical name for a page. If
the page name contains the name of a folder it is in??”like we have a folder named
secure, and the page name is SecurePage, the name of the folder is removed from
the page name.
Pages:
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104