Introduction to Jakarta
Tapestry
(
TapeStry Getting Started)
By Rob Smith, Senior Software Engineer Object Computing, Inc. (OCI)
ORIGINAL:
http://www.ociweb.com/jnb/jnbmay2004.html
Translation: hery tang (hery1977@hotmail.com)
Introduction
Jakarta
TapeStry is an open source Java web application framework. You may say: "Datong is a small thing." Most
In the case, I agree with your point of view, however, as long as I spend a little time study, you will find
TapeStry is very different from other frames, it is worth serious.
Tapestry is a control-based framework for developing a web application similar to developing traditional GUI applications. You use
Tapestry Develops Web Applications You don't have to pay attention to operation-centric servlet API. Quote
One sentence on the TapeStry website: "
TapeStry reinterprets Web application development with objects, methods, methods, properties.
TapeStry 3.0 is about to be released, it has a lot of improvements and new features.
Tapestry's goal
Simplicity
The Tapestry application is less code compared to traditional servlet applications. Most traditional servlet applications contain the following bored
Duplicate tasks: parse the query parameters, process the HTTPSession object, and build URLs.
TapeStry eliminates many of the non-interest "Connect" code in traditional ServelT applications ("Plumbing" Code) enables developers to concentrate on the application logic.
consistency
Tapestry provides a consistent way for the page of the development web application. This helps to eliminate traditional servlet applications. Due to all
The page in the TapeStry application is used to organize the same accessible control, so how the way works is similar.
effectiveness
The TapeStr application has a height of upgradeability, which utilizes the cache and the object pool minimizes the processing time of each request.
The TapeStry app has properties that are similar to traditional servlet applications.
Error feedback
Anyone developing a servlet / JSP application has no question: I have a similar experience: in order to find any mistakes in the web.xml file, you have to spend a lot of time to view the stack information in your browser.
TapeStry has excellent error reporting methods, which is most worth mentioning that it will point out which file and that line leads to errors.
Compare with Struts
Since Apache Struts may be the most widely used web application framework today, take
TapeStry is the only fair to compare it. Here are some observation comparisons, they come from several simple things developed for this article.
TapeStry app and work experience for several Struts projects.
Struts Advantages
1 A servlet / JSP developer is familiar with Struts without having to take too long. however
Tapestry's learning curve presides a little because it is not too the same as the popular web application framework.
2 Struts is widely accepted and used in the Java community. Find a good Struts developer for your project is not difficult,
Tapestry has recently won some attention in the developer community, but there are still many Java veterans who don't know.
What is TapeStry?
3 Since Struts is used in a wide range of use, there are many Struts resources available for reference. Compared to most open source software,
TapeStry has a very considerable resource and document, but there is still a gap compared with Struts.
Tapestry's Advantage 1 You have developed a
TapeStry App No Twymless Write some typical "Connect" code without your servlet application. Although Struts simplifies work, the servlet API is still you need to face.
2
Tapestry's page template is a standard HTML file in addition to several special attributes and identifies. If you are an HTML design master in the development group, you don't understand Java or JSP, which brings you very convenient.
3
The TapeStry page is a standard HTML, so you can edit and preview this page with HTML. When a page needs to modify its appearance, it is not necessary to notify the server to let it recompile the JSP.
4
TapeStry does not require a sufficient profile of the entire application range.
Each page in TapeStry App is independent, changing a page does not affect the developer developer to develop other pages, because there is no configuration file to browse all pages together.
5
TapeStry has excellent error report. If you make an error in a page template or page specification,
TapeStry will point out the line number that causes the wrong error.
6
TapeStry development is a fun. This way, it seems that it seems to be old, but use
TapeStry develops a web application more natural and interesting compared to other popular frameworks. use
TapeStry development is to apply a control-based architecture that is very similar to developing traditional GUI applications.
TapeStry architecture
The TapeStry framework is an extension of the standard servlet API. It requires J2SDK1.2 or higher J2SDK and a compatible application server / servlet container with servlet API 2.2 (or higher).
One
The TapeStry application consists of many pages with a unique name. A page consists of a template and some of the accessible controls. Templates consist of standard HTML tags and some additional properties and labels, these additional properties and labels are to tell
Tapestry Framework This page of this page is
The TapeStry control is composed.
simple
Tapestry application
Build one for the best description
On all aspects of the Tapestry page, we can take a look at this Pig Latin translator application code. This app has only one page. Enter a text value in this page to translate it into Pig Latin, then display the translated value to the user.
in
Each page in the Tapestry application consists of 3 parts: an HTML template, a page specification file, a Java class.
Here are this page screen graphic: The page template is composed of a standard HTML tag and some additional properties and tags, these additional properties and tags are to tell the Tapestry Framework The page of this page is composed of TapeStry controls. The page template is stored in the root directory of the web application. Typically, TapeStry will find and present a page called "Home" at startup. Although we can change this behavior, it will be simpler in accordance with TapeStry. Home.html