RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Rapid Java Web Application Development with Tapestry

Tapestry is a powerful and innovative framework for developing component-based Web applications. With Tapestry 4, things get even better.

he J2EE world is full of development frameworks, all designed to simplify tedious low-level programming tasks and allow the programmer to get on with more interesting business-related stuff. The most well known probably is Struts, the Model-View-Controller (MVC) framework based largely on Struts Action. More recent frameworks are shifting away from the Struts approach in favor of a higher-level, more object-oriented approach that is component-based and event-driven. Among the most interesting of this new generation of frameworks are JavaServer Faces (JSF), which is backed by industry giants such as Sun, and a dynamic and innovative outsider from the Apache Jakarta project called Tapestry.

Introducing Tapestry

Tapestry is an open-source framework for object-oriented, component-based Java Web application development. Simply put, instead of dealing with the Servlet API or with Struts Actions, the Tapestry programmer stores user data with object properties and handles user actions with event-handling methods.

Another major feature of Tapestry is its use of HTML page templates. In Tapestry, each page is an HTML template containing browser-friendly HTML tags. Unlike JSP, JSTL, or JSF pages, creating Tapestry pages is relatively easy using common Web design tools, and you can preview them in a Web browser.

This article demonstrates a few of the main features of Tapestry, and shows how Tapestry 4, released in December 2005, makes things even easier than previous versions.

Setting Up Tapestry

Tapestry is built on the standard Servlet API, which means it will run on any Java servlet container or application server. You just need to set up the Tapestry servlet in your web.xml file, as illustrated here:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

    <display-name> Introduction to Tapestry Tutorial</display-name>
        <servlet-name> app</servlet-name>

You can set the servlet name to anything you like. However, modifying the url-pattern is a bit trickier, so you should leave this as is ("/app").

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date