Home arrow Apache arrow Page 3 - A Closer Look at Simple Components in Apache Tapestry

Source Code - Apache

In the previous article, we took a look at some of the components that are used most often in Tapestry applications, and learned some important concepts related to them. At the end, we found that we needed three components for our example application. In this article, we will configure those components. We will also learn how to disable caching.

TABLE OF CONTENTS:
  1. A Closer Look at Simple Components in Apache Tapestry
  2. Form component
  3. Source Code
  4. How to disable caching
By: Alexander Kolesnikov
Rating: starstarstarstarstar / 21
April 30, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
 

To wrap up what was already done, here is the source code for the template, specification and class for the Home page:

Home.html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

  <head>

    <title>Guess the Word</title>

  </head>

  <body>

      <h2>Guess the Word</h2>

      <form action="" jwcid="secretWordForm">

          Enter the secret word:

          <input type="text" jwcid="secretWord"/>

          <input type="submit" value="Submit">

      </form>

  </body>

</html>

Home.page:

<?xml version="1.0"?>

<!DOCTYPE page-specification PUBLIC

    "-//Apache Software Foundation//Tapestry Specification 4.0//EN"

    "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">

<page-specification class="com.devshed.tapestry.guesstheword.Home">

    <component id="secretWord" type="TextField">

        <binding name="value" value="theWord"/>

        <binding name="hidden" value="true"/>

    </component>

   

    <component id="secretWordForm" type="Form">

        <binding name="listener" value="listener:onWordSubmit"/>

    </component>

  

</page-specification>

Home.java:

package com.devshed.tapestry.guesstheword;

import org.apache.tapestry.html.BasePage;

public abstract class Home extends BasePage {

   

    public Home() {

    }

   

    public abstract String getTheWord();

   

    public String onWordSubmit() {

        return "Secret";

    }

   

}

However, there is one technical issue we need to care of before leaving.



 
 
>>> More Apache Articles          >>> More By Alexander Kolesnikov
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

APACHE ARTICLES

- Apache Unveils Cassandra 1.2
- Apache on ARM Chips? Dell and Calxeda Help M...
- The Down Side of Open Source Software
- VMware Unveils Serengeti for Apache Hadoop
- SAP Takes Steps to Improve Hadoop Integration
- Looking to Hone Apache Hadoop Skills?
- How to Install Joomla on WAMPP
- Working with XAMPP and Wordpress
- GUI Available for Apache Camel
- Reduce Server Load for Apache and PHP Websit...
- Creating a VAMP (Vista, Apache, MySQL, PHP) ...
- Putting Apache in Jail
- Containing Intrusions in Apache
- Server Limits for Apache Security
- Setting Permissions in Apache

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: