Apache
  Home arrow Apache arrow Page 3 - A Closer Look at Simple Components in ...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Developerworks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
APACHE

A Closer Look at Simple Components in Apache Tapestry
By: Alexander Kolesnikov
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 18
    2007-04-30

    Table of Contents:
  • A Closer Look at Simple Components in Apache Tapestry
  • Form component
  • Source Code
  • How to disable caching

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Dell PowerEdge Servers

    A Closer Look at Simple Components in Apache Tapestry - Source Code
    (Page 3 of 4 )

     

    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


       · The tutorial begins to take it shape. It is becoming a kind of weekly newsletter on...
       · Ido Dovrath sent me the following important comment:"I'd like to turn your attention...
       · i got the following error:Compiling 2 source files to C:\Documents and...
       · When I compile my project it gives me the error of port 8084 is already in use. I...
       · This probably means that another instance of Tomcat is already running on your...
       · What is the easiest way to see if i indeed have another instance of tomcat...
       · Looks like you do not have some (or all?) of Tapestry classes are not on the...
       · Navigate to http://localhost:8084/ (if moderator will not remove this string!)
     

       

    APACHE ARTICLES

    - Putting Apache in Jail
    - Containing Intrusions in Apache
    - Server Limits for Apache Security
    - Setting Permissions in Apache
    - Installing Apache
    - Apache Installation and Configuration
    - Apache Tapestry and Custom Components: DateI...
    - Tapestry and AJAX: Autocompleter and InlineE...
    - PropertySelection and IPropertySelectionMode...
    - The DatePicker and Shell Components of Apach...
    - Apache Tapestry: ASO and More Components
    - Apache Tapestry and DirectLink, IoC and DI
    - Making a CelebrityCollector with Apache Tape...
    - Apache Tapestry and Listener Methods, Condit...
    - The Properties of Tapestry Pages




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway