Look at Tapestry

xiaoxiao2021-03-06  135

Note: The following is not enough translation, but it is only a note record. (More

An Overview of Tapestry

Look at Tapestry

Perhaps the hardest part of understanding Tapestry is the fact that it is component-centric not operation-centric. Most web technologies (Struts, servlets, PHP, etc.) are operation-centric. You create servlets (or Actions, or what have you ) that are invoked when a user clicks a link or submits a form. you are responsible for selecting an appropriate URL, and the name and type of any query parameters, so that you can pass along the information you need in the URL.

It may be the most difficult to understand, Tapestry actually operates to components instead of operation, most web technology (...) is operational. You can create a servlet (or what you do with your hand), when the user clicks on a link or submits a form, you will call them. You need to be responsible for choosing an appropriate URL, the appropriate name, type, so you can continue to pass the information obtained from the URL.

You are also responsible for connecting your output pages (whether they are JSPs, Velocity templates, or some other form of templating technology) to those operations. This requires you to construct those URLs and get them into the href attribute of your tag Or Into the action attribute of Your

tag.

You also need to connect to your output page (JSP or Velocity is the template's stuff) to these. This requires you to build some URL then put them in the super chain tag. Or placed in the Action property of the Form tag.

Everything is different inside Tapestry Tapestry applications consist of pages;. Pages are constructed from smaller components Components may themselves be constructed from other components Every page has a unique name, and every component within a page has its own unique id ... this.. IS a Component Object Model. Effectively, Every Component Has An Address That Can Easily Be Incorporated Into A URL.

In TapeStry, all things have become different. The TapeStry application consists of a page; the page is constructed of a smaller component. Components may consist of other components. Each page has a unique name, and each component has its unique identifier in a page, which is a component object model. Each component has an address that can be easily assembled into the URL. In Practical Terms, Your Don't write a servlet for the add-item-to-shopping-cart operation. IN FACT, you don't eve write an address. What you do is take company an existing component, such as DirectLink, and configure it. When the component renders, it will create a callback URL. When you click that link, the callback URL (which includes the name of the page and the id of the component within the page ) will invoke a method on the component ... and that method invokes your application-specific listener method. [1] You supply just the listener method ... not an entire servlet. Tapestry takes care that your listener method is invoked at the right time, under the right conditions You do not have to think about how to build that URL, what data goes in the URL, or how to hook it up to your application-specific code -. that's all handled by the framework.

In an experienced team, you won't write a servlet for add-item-to-shopping-cart. In fact, you don't even need to write an Add-item-to-shopping-cart component. You should not do these broken things. Choose an existing component and configure it, like DirectLink. When it works, it creates a Callback URL. When you point this connection, this callback URL (contains the component ID in the page) will call the method in the component ... and this method calls your application's clear listener method (ghost know what it tells, Continue to turn). You only need to provide a listener method, not an actual servlet. TapeStry is concerned with your listener method in the correct time, correct case, you don't have to construct the URL, you can put data to the URL, or how to hook up with your application code - these are The frame of the frame is controlled. Wow, hahaha ... (will increase the statement, damn)

Tapestry Uses a Component Object Model To Dispatch Incoming Requests to The Correct Page And Component.

TapeStry forwards the request to the correct page with component object models, components


New Post(0)