You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

How do I get started with Tapestry?

The easiest way to get started is to use Apache Maven to create your initial project; Maven can use an archetype (a kind of project template) to create a bare-bones Tapestry application for you.

One you have Maven installed, execute the command mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org. Maven will (after performing a large number of one-time downloads) ask you questions about how to create the new project, including a group id (like a package name) and an artifact id for your new project. Once it is created, you can load it into any IDE and start coding, or use mvn jetty:run 1 . Again, more one-time downloads, but then you can open you browser to http://localhost:8080 to run the application.

Why does Tapestry use Prototype? Why not insert favorite JavaScript library here?

An important goal for Tapestry is seamless DHTML and Ajax integration. To serve that goal, it was important that the built in components
be capable of Ajax operations, such as dynamically re-rendering parts of the page. Because of that, it made sense to bundle a well-known JavaScript library as part of Tapestry.

At the time (this would be 2006-ish), Prototype and Scriptaculous were well known and well documented, and jQuery was just getting started.

The intent has always been to make this aspect of Tapestry pluggable. This is work expected in Tapestry 5.3, where a kind of adapter layer will be introduced so that Tapestry can be easily customized to work with any of the major JavaScript libraries.

Why does Tapestry have its own Inversion of Control Container? Why not Spring or Guice?

An Inversion of Control Container is the key piece of Tapestry's infrastructure. It is absolutely necessary to create software as robust, performant and extensible as Tapestry.

Tapestry IoC includes a number of features that distinguish itself from other containers:

  • Configured in code, not XML
  • Built-in extension mechanism for services: configurations and contributions
  • Built-in aspect oriented programming model (service decorations and advice)
  • Easy modularization
  • Best-of-breed exception reporting

Because Tapestry is implemented on top of its IoC container, and because the container makes it easy to extend or replace any service inside the container, it is possible to make the small changes to Tapestry needed to customize it to any project's needs.


  1. Jetty is a well-known high-performance servlet container. Jetty starts up quickly, and implements the official Servlet specification very closely.

  • No labels