Book Image

Tapestry 5: Building Web Applications

Book Image

Tapestry 5: Building Web Applications

Overview of this book

Table of Contents (17 chapters)
Tapestry 5
Credits
About the Author
About the Reviewers
Preface
Foreword
Where to Go Next

Creating the Border Component


In any real life web application, there is always some content that is repeated on many pages. Such content can include—logo, navigation menu, copyright message, standard links to legal information, contact page and so on. Also, there is almost always a link to a stylesheet in the page code, and if the application is internationalized, it might make sense to have a locale switcher on every page too.

It would be convenient to create all this content just once, and then reuse it on as many pages as we wish, and in this section we are going to build a component that will encapsulate all the common page elements.

Let's start by creating a template and a Java class. The steps required for creating them are the same as when creating a template and a class for a new page, with the only difference being that these should be created in the com.packtpub.celebrity.components package. Please create such a package and then add to it an empty Java class named Border. Also...