Home arrow Apache arrow Apache Tapestry 4 Tutorial

Apache Tapestry 4 Tutorial

In this article we'll begin by taking a look at servlets and JavaServer Pages, then proceed to learn about the MVC design pattern. After examining the problems these technologies solved, we'll focus on the Tapestry framework, study its advantages, and dispel some prejudices about it. This is the first article in a multi-part series covering Tapestry.

  1. Apache Tapestry 4 Tutorial
  2. JavaServer Pages came to the rescue
  3. The Holy Trinity of software development
  4. Why Tapestry?
  5. Tapestry and prejudices
By: Alexander Kolesnikov
Rating: starstarstarstarstar / 159
April 03, 2007

print this article



In the beginning, there were servlets.

A servlet is basically a piece of Java code written in such a way that it can run on a server on the Internet. Servlets live in a so-called servlet container that handles all the low level issues, allowing the servlet author to concentrate on what exactly he or she wants to do.

Servlets are a foundation of every Java Web framework. Struts, JSF, Tapestry - all of them have at least one servlet, at the very least as a gateway between the world of Java and the world of Web.

However, in the early days of Java Web development there were no frameworks, only servlets. And if a developer wanted to display a dynamically created HTML page, he or she would have to print out HTML inside of Java code like this:

out.println("<table border=\"1\" cellpadding=\"5\" width=\"500\">");

Now imagine that your page is a decent size, say, a hundred lines of code. You will have to write a hundred statements like this one. You can easily forget to escape one of those quotation marks or make some other error so that the servlet will not compile. This means the code is very fragile.

But say you managed to do everything properly and your servlet compiles and works just fine. Now your designer decides to change something on the page. Being a true Java programmer you might have no idea about HTML and styles, and your designer certainly has no idea about Java. So who will make the change? This means the code is difficult to maintain. Also, any minor change in the page contents or design will require recompilation of the servlet.

Although the servlets are powerful and efficient, they are not that good when it comes to rendering a dynamic HTML page. Some other solution was needed.

>>> More Apache Articles          >>> More By Alexander Kolesnikov

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Apache Unveils Cassandra 1.2
- Apache on ARM Chips? Dell and Calxeda Help M...
- The Down Side of Open Source Software
- VMware Unveils Serengeti for Apache Hadoop
- SAP Takes Steps to Improve Hadoop Integration
- Looking to Hone Apache Hadoop Skills?
- How to Install Joomla on WAMPP
- Working with XAMPP and Wordpress
- GUI Available for Apache Camel
- Reduce Server Load for Apache and PHP Websit...
- Creating a VAMP (Vista, Apache, MySQL, PHP) ...
- Putting Apache in Jail
- Containing Intrusions in Apache
- Server Limits for Apache Security
- Setting Permissions in Apache

Developer Shed Affiliates


Dev Shed Tutorial Topics: