Apache
  Home arrow Apache arrow Making a CelebrityCollector with Apach...
Dev Shed Forums 
Administration  
AJAX  
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 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 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

Making a CelebrityCollector with Apache Tapestry: the For Component
By: Alexander Kolesnikov
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 25
    2007-05-09

    Table of Contents:
  • Making a CelebrityCollector with Apache Tapestry: the For Component
  • Creating an object model
  • Creating pages
  • The For component

  • 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


    Making a CelebrityCollector with Apache Tapestry: the For Component


    (Page 1 of 4 )

    We are going to start a new project today, named CelebrityCollector. At first it will be very simple, but in the following articles we’ll be adding more and more functionality to it. Of course, the purpose at this stage of study is not to build a real-world application but to meet different Tapestry components and to learn various important concepts.

    Creating the project

    Create a new project as explained in the article “Creating Your First Tapestry Project” and name it CelebrityCollector. Don’t forget to add the Tapestry41 library and configure the Tapestry servlet properly.

    Add to the project three empty pages: Home, CelebritiesList and Details (see the “Introducing Simple Components in Apache Tapestry” article for an explanation on how to add empty pages; this operation will be simplified significantly when we’ll adopt the NBTapestry module in one of the upcoming articles). Let the package containing page classes be com.devshed.tapestry.celebrities.

    Let’s envision what we are going to have in the project so far. The Home page will only have one link (already familiar to you as the PageLink component). Upon clicking this link the user will see the CelebritiesList page.

    The CelebritiesList page will display a table with a number of celebrities’ names in it. Each surname will be a link, and if the user clicks on it, the Details page with information on the selected celebrity will open.

    As usual, let’s start from mock ups. Here is the Home page mock up and its HTML code:

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

     

    <html>

      <head>

        <title>Celebrity Collector: Home</title>

      </head>

      <body>

          <h1>Celebrity Collector</h1>

         

          <p><a href="">List Celebrities</a></p>

     

      </body>

    </html>

    The CelebritiesList page mock up and its HTML code are shown below. The designer who worked on the mock up didn’t know which celebrities we are going to list, so he put some arbitrary names into the table, just to see how everything might look in the working application.

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

     

    <html>

      <head>

        <title>Celebrity Collector: List</title>

      </head>

      <body>

         

      <h2>Celebrities in Collection:</h2>

     

      <table width="300" cellpadding="5" border="1">

          <tr>

              <th>Last Name</th>

              <th>First Name</th>

          </tr>

          <tr>

              <td>

                  <a href="">Smith</a>

              </td>

              <td>John</td>

          </tr>

          <tr>

              <td>

                  <a href="">Smithson</a>

              </td>

              <td>Jane</td>

          </tr>

          <tr>

              <td>

                  <a href="">Swedenborg</a>

              </td>

              <td>Emmanuel</td>

          </tr>

      </table>

     

      </body>

    </html>

    Finally, here is some content for the Details page mock up:

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

     

    <html>

      <head>

        <title>Celebrity Collector: John Smith</title>

      </head>

      <body>

     

      <h2>John Smith</h2>

         

      <table>

          <tr>

              <td><b>Birthday:</b></td>

              <td>01/01/1950</td>

          </tr>

          <tr>

              <td><b>Occupation:</b></td>

              <td>Actor</td>

          </tr>

      </table>

      <p><a href="">Back to the list</a></p>

     

      </body>

    </html>

    Now, before going into the specifics of Tapestry development, we need to think about which Java classes we might need in order to manipulate information in our application – store it, transfer, etc. In other words, we need to design an object model. This is not Tapestry specific work but something we would do in any Java Web application.

    More Apache Articles
    More By Alexander Kolesnikov


       · In this issue we are beginning to build a new application, and I am going to use it...
       · <property name = "currentCelebrity"/> <component id="eachCelebrity" ...
       · Please see Alexander's previous article for its...
       · public abstract class CelebritiesList extends BasePage { public List...
       · Why not? Count the brackets ;)
       · So, I get the error below. I was wondering if you could please also give some...
       · Here is the HTML code that got left out from above: <tr...
       · Any takers?? Alex?
       · OK, so the porblem seems to be that I can not put a tapestry component in a table...
       · <property name = "currentCelebrity"/>The above is equivalent to creating a...
     

       

    APACHE ARTICLES

    - Creating a VAMP (Vista, Apache, MySQL, PHP) ...
    - 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...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT