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 a Library of Custom Components


We have created two custom components that can be useful for many other web applications, and the natural desire is to use them to create a library and use it whenever it might become needed. Fortunately, it is very easy to add a library of custom components to a Tapestry 5 application—all we need is to put the library into the WEB-INF/lib directory of that application. Tapestry will automatically discover the available components, and our task will be simply to use these components whenever we need them.

It is not too difficult to create a library of custom components. All we need to do is to package all the appropriate classes into a JAR file, add one Tapestry-specific line to the manifest of that file, and create a module class that will serve as a kind of anchor for the library. Tapestry will find and load this module. From it, Tapestry will find out where exactly to look for the library's components. The Library module should be packaged into the...