Introduction to Jakarta Tapestry (Tapestry entry) by Rob Smith, Senior Software Engineer Object Computing, Inc. (OCI) original (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 small things are." In most cases, I agree with you, however, as long as speaking a little time study, you will find that Tapestry is very different from other frames, it is dedicated to treat . Tapestry is a control-based framework for developing a web application similar to developing traditional GUI applications. You don't have to focus on the operation-centric servlet api with Tapestry (Operation-Centric) Servlet API. Quote a sentence on the TapeStry website: "TapeStry uses objects (Objects), method (Properties) replaces past URLS and query parameters, reinterpretation of web application development. Tapestry 3.0 is about to be released, it has a lot of improvements and new features. Tabestry's target Simplified Tapestry application is less compared to traditional servlet applications. Most traditions The servlet application contains the following tired and repeated tasks: parsing the query parameters, handles httpsession objects, and builds urls.tapestry eliminates many of the "Plumbing" Code "in traditional ServelT applications (" Plumbing "Code) enables developers to concentrate on application logic Come up. Conformance Tapestry provides a consistent way for the development of web applications. This helps to eliminate traditional servlet application development. Since all TapeStry applications are organized with the same accessible controls, So the working method is similar. Efficiency TapeSTR Application has a high degree of upgradeability, which utilizes the cache and object pool minimizes each request. The Tapestry application has the performance that is similar to the traditional servlet application. Error feedback any development servlet / JSP application has no question: In order to find out what is wrong with 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 mode, the most worth mentioning is It will point out which file and that line leads to errors. Since Apache Struts may be the broadest web application framework for today's application, TapeStry is the only fair. Here are some observations, they come from this Several simple TapeStry applications developed and work experience for several Struts projects. Struts Advantage 1 A servlet / JSP developer is familiar with Struts No need to take too long. However, TapeStry's learning curve presides, because it is popular The web application framework is not too different. 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 old hands. I don't know what TapeStry is. 3 Since Struts is used in so widely, there are many Struts resources available. Compared to Most open source software, TapeStry has very considerable resources and documents, but there is still a gap compared to Struts.
Tapestry Advantage 1 You have developed a TapeStry application without paying attention to the Servlet API, you don't have to write some typical "Connect" code for your servlet. Although Struts simplifies work, the servlet API is still you need to face. 2 Tapestry Page Template In addition to several special attributes and identifies are a standard HTML file. If you are an HTML design master in the development group, you don't understand Java or JSP, which brings you very convenient. 3 Because the TapeStry page is a standard HTML, you can edit and preview this page with the HTML you have obtained (Wysiwyg) editor. When a page needs to modify its appearance and do not need to notify the server to restore the JSP. 4 TapeStry does not require a sufficient, the entire application scope profile. 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 an excellent error report. If you make a mistake in a page of the template or page specification, TapeStry will indicate the line number that causes the error. 6 Developed with TapeStry is a fun. This way, it seems that it seems to be old, but use Tapestry to develop a web application more natural and interesting than other popular frameworks. Developing TapeStry is to apply a control-based architecture that is very similar to developing traditional GUI applications. The TapeStry Architecture Tapestry Frame 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). A TapeStry application consists of many pages with unique names. A page consists of a template and some of the accessible controls. Templates consist of standard HTML tags and some additional properties and tags, these additional properties and tags are to tell the Tapestry Framework These pages are composed of TapeSTRY controls. Simple TapeStry App For the best description, we can take a look at the code of this Pig Latin translator application. 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. Each page consists of 3 parts in the TapeStry application: 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