First of all, let's add another page to have more space for experimenting. Right click on the Start.tml
file in the Project Explorer or Projects view, depending on which IDE you are using. Click on Copy, in the context menu. Then right click on the WebContent folder in Eclipse or Web Pages folder in NetBeans and then click on Paste. Rename the new page to be... well, let it be Another.tml
. Change the contents of the new page template to look like this:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> <head> <title>Another Page</title> </head> <body> <h1>Another Page</h1> <p> <t:PageLink t:page="Start">Back to the Start page</t:PageLink> </p> </body> </html>
Next, right click on the com.packtpub.t5first.pages package and add a new Java class, name it Another. Let this class remain empty for the moment. Finally, change the PageLink
component in the Start.tml
file to point...