Apache Tapestry Tutorials, Second Attempt
The first attempt was with SitePoint. At that time (February 2006) I have just completed my first commercial Tapestry project using Tapestry 3 and helpful Spindle and was eager to share what I have just learnt. That tutorial was named "Step-by-Step Jakarta Tapestry", as at that time Tapestry was still under Jakarta project.
The first tutorial still has some value. It will be certainly useful for those who decide to use Tapestry 3 on one or another reason. It demonstrates how to work with Spindle, and that was a great tool. Finally, it explains very patiently (some people might say too patiently) how to install Java, Eclipse etc. on different platforms.
After a year, and that was an extremely eventful year, I found myself working in a large company building a Java Web application of a significant size. The company was going to use Struts for the front end, but somehow I was able to convince my manager that Tapestry 4 would be a better choice. It wasn't easy for him to accept my suggestion, but I think he is very happy now that he did that.
The more I work with Tapestry, the more I like it, as it is so cleverly, and I would say insightfully designed. You won't understand how much less code you need to write when using it until you adopt the framework. The only problem is that there are not so many Tapestry developers, and perhaps the main reason for the lack of them is that there are not so many Tapestry tutorials. So I decided to fill the gap.
SitePoint wasn't as helpful as before. They were too busy editing their books and my article on Tapestry 4 remained unedited for a few months. In any case, they were not going to publish as many articles as I was going to write. I can understand them though as SitePoint is mainly the community of Web designers and PHP coders, most of them have no idea of why Java is needed at all.
But then I found another publisher, DevShed, and this is when the work really took off. I don't know how many issues of this series of Tapestry 4 tutorials I will be able to write, but I am completing the 14th issue now, and I feel like I am still in the very beginning.
Here you can see the list of all the issues published so far, and I am going to update it regularly:
1. Apache Tapestry 4 Tutorial.
In this article we'll begin by taking a look at servlets and JavaServer Pages, then proceed to learn about the MVC design pattern. After examining the problems these technologies solved, we'll focus on the Tapestry framework, study its advantages, and dispel some prejudices about it. This is the first article in a multi-part series covering Tapestry.
2. Preparing the Workspace for Apache Tapestry
In the previous article of this series I explained, in the historical perspective, why Tapestry is a very attractive and advanced framework for building Java Web applications. Now we are moving from theory to practice. But before doing anything, we need to prepare the workplace.
3. Creating Your First Tapestry Project
In the previous article, we began moving from theory to practice by preparing our work place and setting up our system. In this article, we actually get our hands dirty (at least figuratively) by building our first Tapestry project.
4. Introducing Simple Components in Apache Tapestry
In the previous article, you witnessed the interplay between a Tapestry page and its components (granted, we had only one simple component there, but you get my point). Page class, when rendering its page, finds any components mentioned in the template and asks those components to display themselves, as they know better how to do that. Components, in their turn, might need some information to display themselves, and they ask the page class to provide the necessary information by calling some of its methods.
5. A Closer Look at Simple Components in Apache Tapestry
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.
6. The Properties of Tapestry Pages
In the previous part of this tutorial we started to build a new project, GuessTheWord. The project is very simple, but we are going to spend a lot of time working on it and experimenting with it. This is because the main aim is to learn a lot about the most basic concepts of Tapestry. For every important concept, I want to show you a number of options as to how it can be implemented and explain which option is good for what.
7. Apache Tapestry and Listener Methods, Conditional Components and PageLink
Today we continue to explore some of the most fundamental concepts of Tapestry while building one of the simplest Java Web applications. In the previous part of this tutorial we became familiar with properties of Tapestry pages and different ways to configure them. Now we’ll look into the details of writing listener methods.
8. Making a CelebrityCollector with Apache Tapestry: the For Component
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.
9. Apache Tapestry and DirectLink, IoC and DI
Previously we began building our CelebrityCollector application. But right now it is a hollow shell. In this article we will use several new Apache Tapestry components to help us start filling in the details.
10. Apache Tapestry: ASO and More Components
We shall continue working on the CelebrityCollector application. The next step is to create a page for adding a new celebrity. While we create that page, I will introduce you to three more components that will add new capabilities to our application and help us get around certain problems.
11. The DatePicker and Shell Components of Apache Tapestry
In the previous article in this series we came to adding a component for accepting a date input, to specify the date of birth for the newly added celebrity. DatePicker, a standard Tapestry component, is an excellent choice for this, and we are going to learn today how to add a DatePicker to a page.
12. PropertySelection and IPropertySelectionModel in Apache Tapestry
We already encountered PropertySelection in one of the previous articles so we know that it is a Tapestry component used to display a drop-down list, allowing the user to choose one of multiple options. You might think that the way in which options are provided to this component (through its model binding) is somewhat cumbersome when all you need to do is select one of a few strings. However, PropertySelection was designed with a great deal of power and flexibility in mind, and I hope that today you will appreciate this.
13. Tapestry and AJAX: Autocompleter and InlineEditBox
Although the term "AJAX" was coined not so long ago, AJAX-like functionality has already been available in Tapestry for quite some time. In Tapestry 4.0 we can use Tacos, a rich and interesting library of custom Tapestry components that includes a number of AJAX-driven components. Tapestry 4.1 has Dojo JavaScript library built into it, so it comes with some core AJAX-enabled components.
14. Apache Tapestry and Custom Components: DateInput
Tapestry has many benefits, but perhaps one of the most important is that it makes creation of custom components very easy. In this article, I'll create a custom component to illustrate this point.