Introduction to Web Development mode tapestry

Source: Internet
Author: User
Tags html page

Objective

Because of the widespread popularity of internet technology, more and more program development mode is converting from C/s to B/s, because the B/S model has the advantage of thin client--no need to install the client program, this greatly reduces the cost of software upgrades, all business logic and database storage are placed on the service side Thus the maintainability of the system is improved. And because the HTTP protocol is an open standard, so long as it is to support the HTTP protocol browser can be run, combined with the current XML technology, can be easily implemented across the platform of distributed applications.

But the B/s structure has its inherent disadvantage: no State nature. This is not really the B/s program, but because the B/s program is based on the HTTP protocol, so the program can not maintain the state of each client, but fortunately this problem has now been resolved.

Another major drawback of the current B/s development is that the code and HTML pages are rubbed together, are bad for programmers and artists, and the maintenance of code is a nightmare, which is believed to be an experience of many web developers. The C/s structure does not have this flaw, because it is based on components, such as VB, you have countless ActiveX control to complete some complex interface.

Perhaps you see here, in the heart of the calculation: still with C/s forget, save so much trouble, but a company that does not dare to try new technology is often a company eliminated by new technology.

To solve the above problems, the Apache organization developed a JSP based MVC pattern implementation: struts. It divides the Web presentation layer into Model-view-controller, a servlet that controls the process of the web, and it does make a lot of progress compared to a simple JSP or ASP, because using struts clearly defines the process of the web, And do not advocate the use of <% ...%> statements, instead of the taglib technology. But it never gets rid of the code and HTML page rub and the problem, and its principle for JSP beginners is more complex, taglib Library is not rich enough, and taglib is not as able to inherit as components.

Thus, a new generation of web development methods came into being, they are most typical of the development method is based on components, the most representative of which is tapestry.

Why do you use tapestry?

Tapestry is now part of the Apache Jakarta Project, and you can access http://jakarta.apache.org/tapestry to access more information.

Tapestry is a powerful, open source, java-based framework for developing high-end Web applications. It is an alternative to JSP, using tapestry, so that your page can not see a JSP code, which makes the page looks very clean. It can construct an extremely complex web application with very little code.

Tapestry uses a development approach similar to traditional C/s: component-based development. Using tapestry, you can get the following benefits:

1, very high code reusability, because in tapestry, everything can be considered as a reusable component.

2, the JSP developers from the cumbersome JSP code freed, instead of the real face image method, rather than URL parsing.

3, the full support of the internationalization of the page

4, accurate error reporting, you can locate the error in the source program line, replacing the JSP in those inexplicable strange error prompts.

Fully support team development, the artist and Java developers can get along well with each other without relying on each other.

You might ask: If Tapestry is based on components, then how does its components form? It is made up of a definition file (in XML format), an HTML template, and a Java class. Tapestry components can be grouped together to form a larger component or logical page.

Tapestry works as follows: Define a servlet named Applicationservlet in the Web.xml file to handle all HTTP requests, which is somewhat similar to struts, but it is primarily responsible for booting the entire tapestry core, starting the log function, and reading Configuration file, create a work engine to assign customer requests. Applicationservlet mainly through its configuration file for its own management, You can specify this configuration file by defining an initial parameter named Org.apache.tapestry.specification-path in Web.xml, of course, if you find this troublesome, you may not specify a profile, but tapestry will automatically look for the servlet Configuration files with the same name, such as those in Web.xml, are defined as follows:

<servlet>
<servlet-name>Registration</servlet-name>
<servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.