Tapestry

Templates in Tapestry are mainly HTML documents, with elements to be replaced with the results of Javascript code being normal HTML elements with a special attribute that identifies it as a Tapestry template element. An XML file defines the mapping between the marked HTML elements, and the Java components they correspond to. This is markedly different from the typical mechanism used by PHP, ASP, and JSP, which use special tags to enclose template variables and code.

Created by Howard Lewis Ship, the Tapestry project has been moved into the Apache Software Foundation.

Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry divides a web application into a set of pages, each constructed from components. This provides a consistent structure, allowing the Tapestry framework to assume responsibility for key concerns such as URL construction and dispatch, persistent state storage on the client or on the server, user input validation, localization/internationalization, and exception reporting. Developing Tapestry applications involves creating HTML templates using plain HTML, and combining the templates with small amounts of Java code using (optional) XML descriptor files. In Tapestry, you create your application in terms of objects, and the methods and properties of those objects — and specifically not in terms of URLs and query parameters. Tapestry brings true object oriented development to Java web applications. Tapestry is specifically designed to make creating new components very easy, as this is a routine approach when building applications. The distribution includes over fifty components, ranging from simple output components all the way up to complex data grids and tree navigators.

Tapestry is architected to scale from tiny applications all the way up to massive applications consisting of hundreds of individual pages, developed by large, diverse teams. Tapestry easily integrates with any kind of backend, including J2EE, HiveMind and Spring.

Tapestry is released under the Apache Software Licence 2.0.

Tapestry organization

Tapestry is organized around four key principles:

  • Simplicity – web applications shouldn’t be rocket science!
  • Consistency – what works in pages should work in components. What works in small applications should work in large applications. Different developers should find similar solutions to similar problems.
  • Efficiency – applications should be performant and scalable
  • Feedback – when things go wrong, the framework should not get in the way; in fact, it should provide useful diagnostics

These four principles drive the meta-principle: The simplest choice should be the correct choice.

The decisions you make early in a project should not come back later to haunt you. We have found that a component approach to web development is the best way of realizing these principles. Structuring the framework and your application around components makes it possible to move all the boring plumbing code out of your application and into the framework. You write less code, you write simpler code, sometimes you write no code. Tapestry picks up the slack.

Third Party Components

Additional libraries of Tapestry components by third parties.

BeanForm All-in-one, flexible bean editor.
Sotacs Some more Tapestry Components, including menus, Ajax text fields and dynamic images
Tacos Suite of Ajax-enabled components.
Tapestry Menu Component Tapestry version of JSCookMenu.
TapFX A set of dynamic, skinnable, DHTML enabled, client-side state preserving web components.

IDE Integration

These open-source, third party extensions allow you to more easily develop your Tapestry applications using popular IDEs.Tapestry is a Java-based web application framework that uses XML to implement applications in accordance with the model-view-controller design pattern. With an emphasis on simplicity and ease of use, Tapestry aims to avoid forcing programmers to create enormous blocks of “glue code”. By having strong binding between the elements on the web page itself and the underlying code, the construction of applications is a lot more straightforward. Its component-based architecture borrows many ideas from WebObjects.

Eclipse eZing Builder Visual editor for HTML with Tapestry extensions.
Spindle Integrated editting and simple refactoring. Stable version is Tapestry 3 only.
Palette Extends Spindle with palette-based drag and drop editting.
IDEA TapIDEA Wizards, highlighting, auto-completion and navigation. Supports Tapestry 5.
HandyTapestry Helpful completions and navigations in the HTML template, and a Create Tapestry component wizard.