Jakarta > Tapestry
Jakarta
 

Jakarta Tapestry

Quick Links

Quick links to the most common subjects:

User's Guide - Quick Start Tutorial - Component Reference - JavaDoc - FAQ - Downloads - Wiki - JIRA (issue tracking)

What is Tapestry?

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.

What is Tapestry's philosophy?

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.

Tapestry 4.0

Tapestry 4.0 is just overflowing with new features aimed at further enhancing your productivity. Here's a few of our favorites:

  • The new 4.0 specification DTDs have been simplified.
  • The syntax used for binding parameters inside an HTML template and inside an XML specification is now consistent. Both make use of the binding prefixes.
  • "Friendly" URLs (that is, URLs that pack more information into the path and less into query parameters) are built in. This makes it easy to divide your application across many folders (reducing clutter), and leverage J2EE declarative security along the way.
  • Listener methods are much easier and more flexible; listener parameters in the URL are automatically mapped to listener method parameters, and listener methods can return the page name or page instance to activate.
  • Component parameters now just work, without having to worry about "direction".
  • Applications can now have a global message catalog, in addition to per-page and per-component message catalogs. Messages not found in the component message catalog are searched for in the application catalog.
  • Full, native support for developing JSR-168 Portlets has been added.
  • Tapestry 4.0 makes much less use of reflection and OGNL than Tapestry 3.0; partly because there are many new binding prefixes and largely because of how parameters are now implemented.
  • HiveMind services and Spring beans can be directly injected into page and component classes.
  • Tapestry 4.0 includes optional JDK 1.5 annotation support (but Tapestry still works with JDK 1.3).
  • Tapestry 4.0 debuts a new and much more sophisticated user input validation subsystem. Thanks Paul!
  • Line precise error reporting can now display the contents of files containing errors.
  • Forms can now be canceled, bypassing client-side validation logic, and invoking an alternate listener on the server-side.
  • You are no longer limited to just Global and Visit; you can have as many application state objects as you like.
  • The use of HiveMind under the covers means that Tapestry can be easily customized to fit your needs.
  • Page properties can now be persisted on the client, as well as in the session.
  • Components and component parameters can now be marked as deprecated. Component parameters may have aliases (used when renaming a parameter).

The complete list of changes is almost too numerous to enumerate. Suffice to say, everything is about getting more bang for the buck, and reducing the amount of Java code, reducing the complexity of templates, and simplifying (or eliminating) XML files.

Status

Work on Tapestry 4.0 is in full swing. Documentation is being converted from the old DocBook format, to the new Forrest format, leaving many temporary gaps. A new Quick Start series of tutorials is being written.

Tapestry 4.0 is nearing the end of its beta cycle; new features are being deferred to Tapestry 4.1 and the emphasis is on filling gaps in the documentation and fixing bugs. A final release for Tapestry 4.0 is expected (but not guaranteed) in October 2005.

Upgrading from Tapestry 3.0

Tapestry 4.0 features a large number of new features, and is some limited cases, backwards compatibility has been compromised. Full details are forthcoming, but in general:

  • Tapestry 3.0 page and component specifications are still honored
  • Page and component templates have not changed

Things that will cause you trouble when upgrading:

  • Defining engine services has changed entirely, as has the IEngineService API
  • Subclassing BaseEngine to override exception handling has changed; it is now about creating and contributing new HiveMind services to override the default behavior.
  • Parameter direction "custom" is no longer really supported. Defining a parameter always creates a corresponding property.
  • The parameterNameBinding property is no longer created for each parameter, instead you must use the getBinding() method.
  • The relationship between the page loader and the specification delegate has changed; the specifications provided by the delegate are now cached by the loader (in 3.0, the delegate was responsible for caching).
  • The Jakarta commons-lang library is no longer a dependency of Tapestry; this means that the EnumPropertySelectionModel class is no longer available (however, you can easily copy the source from Tapestry 3.0).
  • For the Submit component (as well as LinkSubmit and ImageSubmit), the invocation of the listener is (by default) deferred until the end of the form submission, just before the Form's listener is invoked. In Tapestry 3.0, the invocation was immediate. Deferred is better for most, but not all, situations.

Tapestry in Print

Tapestry in Action Cover

Tapestry in Action is now available from Manning Publications. It is the definitive introduction to Tapestry written by Howard Lewis Ship, the creator of Tapestry. Tapestry In Action covers Tapestry 3.0, but is still broadly useful in the wake of the 4.0 release.

Enjoy Web Development with Tapestry Cover

Enjoy Web Development with Tapestry by Kent Tong covers Tapestry 4.0 (as well as 3.0) and is available in PDF and hard-copy formats.

Tapestry Webanwendungen mit dem Apache Framework

Tapestry Webanwendungen mit dem Apache Framework is a fast-paced guide to using Tapestry, focusing on combining Tapestry with other open-source frameworks, as well as developing Tapestry applications using Spindle. The book is written in German, and authored by Stefan Edlich and Patrick Kunert. Covers Tapestry 3.0.

Tapestry has also been described in the print journal The Java Report in the September 2001 issue. Other articles includes the on-line journal OnJava, in November 2001.

Tapestry Community

Tapestry has a very active User mailing list, with archives. This is the list for getting help with using the framework.

The Developer mailing list is for Tapestry committers and other power users to discuss enhancements to the framework. It also has archives.

A Wiki has been set up to discuss Tapestry and plan new features, as well as provide a list of Tapestry tutorials.

Tapestry Support

Tapestry Support Network

The Tapestry Support Network is a consortium of professional software trainers and consultants that provide customized Tapestry training and teir-one support. The network includes key players in the Tapestry world, including Howard Lewis Ship and Erik Hatcher, as well as other organizations, including Interface21 and ArcMind.