Tapestry 5: Building Web Applications
This is the very first book on Apache Tapestry 5, one of the coolest Java Web frameworks.
The aim of the book is to show how to build a Java Web application quickly and easily. Although Tapestry is considered to have a steep learning curve, the book should be very easy to read and understand. I do believe that with its help you will start creating Tapestry applications in no time.
The book assumes that the reader is reasonably comfortable with the Java programming language, but no knowledge of web technologies is needed.
For experienced Servlet, JSP, or Struts developers, the book will show an alternative way that will allow them to raise their productivity to an incomparable level. With this book you will see that a contemporary component-based framework can be easy to learn and a pleasure to work with.
The Contents of the Book:
Chapter 1, Introduction
Discusses the place of Tapestry between different Web development frameworks. I believe that Tapestry, and especially its latest fifth version, can become the Savior in the world of Java Web development, and this chapter explains why exactly I think so.
Chapter 2, Creating Your Working Environment
Creating a working environment for any kind of Web development can be a daunting task, but with Tapestry 5 it is almost two easy. In this chapter we are using Maven to create a project skeleton, and then continue to work with the project in either NetBeans or Eclipse - choose whichever you prefer.
The first project is very simple as the purpose is simply to make sure that everything was configured properly, but we'll also try debugging.
Chapter 3, The Foundations of Tapestry
We are discovering what Tapestry page is and how it works, how to add a page to the project and how to give the project some logical structure by placing pages into different directories.
We are using expansions, meeting a few most often used components, navigating between pages and passing a value from page to page. Finally, we are creating an Application State Object and learning to use it properly.
Chapter 4, Simple Components
This chapter explains how to use the majority of Tapestry components and explores the process of form submission. To show how different components can be used in a real life Web application, a new project, Celebrity Collector, is started in this chapter, to be further developed in the following chapters.
It is also explained how to configure an Application State Object so that its return type was an interface.
Chapter 5, Advanced Components
In this chapter we are learning to use some of the most interesting components - Grid, BeanEditForm and DateField. They allow us to bring into our project a lot of impressive functionality, and with absolutely minimal effort.
Another interesting component, FCKEditor, is available as a third party library, and the chapter demonstrates that using third party components in Tapestry 5 is extremely easy.
Chapter 6, User Input Validation
We have a look at what it takes to validate user input in a Tapestry 5 application by adding validation to our Celebrity Collector project. Validation was already quite good in the previous version of the framework, Tapestry 4, but now it made another huge step forward. It frees developers from doing boring staff and does a lot of nice things automatically.
Chapter 7, Internationalization and Localization
Java platform already has a robust support for i18n, but Tapestry manages to add to it a lot of power and flexibility. We are creating and using message catalogs, switching locale of our Web application, learning how to localize images and other resources and how to use localized templates.
Chapter 8, Creating Custom Components
One of the strongest features of Tapestry is that it allows to create custom components very easily. In this chapter we are creating a couple of useful components - for an alternative way of entering a date and for switching the application's locale, learning how to unleash the power of the Select component, creating a custom service and finally packaging new components in a JAR file so that they could be easily reused in a different application.