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 speaking a little time study, you will find that 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 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.
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. Since all the pages in all Tapestry applications are used to organize the same accessible controls, the working mode 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, TapeStry is the only fair. Here are some observations, they come from several simple Tapestry applications developed for this article and have experienced a few 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 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 Tapestry is.
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 to Struts.
Advantages of Tapestry
1 You have developed a Tapestry app without paying attention to the Servlet API, you don't have to write some typical "connection" 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 does 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.
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).
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 Application
For the best description, build a TapeStry page, we can take a look at the code for this Pig Latin translator. 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 is this page screen graphic:
The page template is composed of a standard HTML tag and some additional properties and tags, which are to tell the Tapestry Framework These pages consist 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