5.2. Page Template

Home.html. 

<html>
  <body>
    <span jwcid="@Insert" 1 value="message:msg.instruction" 2 >
      Please provide details for a personalized greeting. 3 
    </span

    <form jwcid="registrationForm">
      <table>
        <tr>
          <td>
            <span jwcid="titleLabel" 4 >
              Title:
            </span>
          </td>
          <td>
            <input jwcid="title@TextField" value="ognl:user.title" 5 type="text" 6 size="5" 7 />
          </td>
        </tr>
        <tr>
          <td>
            <span jwcid="firstNameLabel" value="message:label.firstName">
              First Name:
            </span>
          </td>
          <td><input jwcid="firstName" type="text" /></td>
        </tr>
        <tr>
          <td>
            <span jwcid="lastNameLabel">
              Last Name:
            </span>
          </td>
          <td><input jwcid="lastName@TextField" 8 value="ognl:user.lastName" type="text" /></td>
        </tr>
        <tr>
          <td>
            <input jwcid="@Submit" label="Submit" 9 type="submit" value="Submit"/>
          </td>
          <td></td>
        </tr>
      </table>
    </form>
  </body>
</html>

1

Implicit component declaration.

2

Message binding. The attribute value is a key in the resource bundle.

3

Preview text. This text will be replaced by the text output by the enclosing component.

4

Explicit component declaration.

5

Dynamic binding. The attribute value is an OGNL expression.

6

Reserved parameter.

7

Informal parameter.

8

Identified implicit component.

9

Static binding. The attribute value is a literal string.

Welcome.html. 

<html>
  <body>
    Hello <span jwcid="userName">Mr. Jack Bauer</span>, welcome to Tapestry!
  </body>
</html>