Hello World Explained

A Tapestry page is usually defined by a Template and a Class.
The template for this page is HelloWorldExplained.tml, and the class source is HelloWorldExplained.java. They are shown below.

The template lays out the page's content. The class handles the input and output field values.
The class for this page is empty because there are no input or output fields to handle.

The template combines HTML elements with Tapestry components.
In the source code below you will see t:pagelink and t:sourcecodedisplay. The t: tells us they are not normal HTML elements; they are Tapestry components.

We used PageLink to generate an HTML link to our Index page which we labelled "Home". PageLink is a core Tapestry component.
We used SourceCodeDisplay to output the 2 source files as HTML. SourceCodeDisplay is provided by JumpStart.

Page location is important. Pages must be located in a package called pages because Tapestry gives special treatment to that package.
Here is an example of page location: References: Component Templates, Component Classes, PageLink.

Home

HelloWorldExplained.tml


<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
<body style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;">

    <h1>Hello World Explained</h1> 
    
    A Tapestry page is usually defined by a <strong>Template</strong> and a <strong>Class</strong>.<br/>
    The <strong>template</strong> for this page is <em>HelloWorldExplained.tml</em>, 
    and the <strong>class</strong> source is <em>HelloWorldExplained.java</em>. They are shown below.<br/><br/>
    
    The <strong>template</strong> lays out the page's content. The <strong>class</strong> handles the input and output field values.<br/>
    The class for this page is empty because there are no input or output fields to handle.<br/><br/>

    The template combines HTML elements with <strong>Tapestry components</strong>.<br/> 
    In the source code below you will see <code>t:pagelink</code> and <code>t:sourcecodedisplay</code>. 
    The <code>t:</code> tells us they are not normal HTML elements; they are Tapestry components.<br/><br/> 

    We used <strong>PageLink</strong> to generate an HTML link to our <em>Index</em> page which we labelled "Home". PageLink is a core Tapestry component.<br/>
    We used <strong>SourceCodeDisplay</strong> to output the 2 source files as HTML. SourceCodeDisplay is provided by JumpStart.<br/><br/>
    
    <strong>Page location</strong> is important. Pages must be located in a package called <em>pages</em> because 
    Tapestry gives special treatment to that package.<br/>
    Here is an example of page location: 
    <ul >
        <li>JumpStart's root package is <em>jumpstart.web</em> .</li>
        <li>Therefore its "pages" package is <em>jumpstart.web.pages</em> .</li> 
        <li>All of JumpStart's pages are in it, eg. <em>jumpstart.web.pages.examples.start.HelloWorldExplained</em> .</li>
    </ul>
    
    References: 
    <a href="http://tapestry.apache.org/component-templates.html">Component Templates</a>, 
    <a href="http://tapestry.apache.org/component-classes.html">Component Classes</a>, 
    <a href="http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/PageLink.html">PageLink</a>.<br/><br/>
    
    <t:pagelink page="Index">Home</t:pagelink><br/><br/>

    <t:sourcecodedisplay src="/web/src/main/java/jumpstart/web/pages/examples/start/HelloWorldExplained.tml"/>
    <t:sourcecodedisplay src="/web/src/main/java/jumpstart/web/pages/examples/start/HelloWorldExplained.java"/>
</body>
</html>

HelloWorldExplained.java


package jumpstart.web.pages.examples.start;

public class HelloWorldExplained {
}