tapestry5 Pages&Components

摘自网上,以便日后查看

Pages and components

Tapestry divides an application into a set of pages. Each page is assembled(装配) from Tapestry

components. Components themselves may be assembled from other components ... there's no artificial depth

limit.

Tapestry pages are themselves components, but are components with some special responsibilities(职责).

All Tapestry components can be containers of other components. Tapestry pages, and most user-defined

components, have a template, a special HTML file that defines the static and dynamic portions of the

component, with markers to indicate where embedded components are active. Components do not have to have a

template, most of the components provided with Tapestry generate their portion of response in code, not

using a template.

Components may have one or more named parameters which may be set (or, more correctly, "bound") by the

page or component which contains them. Unlike Java method parameters, Tapestry component parameters may be

bidirectional; a component may read a parameter to obtain a value, or write a parameter to set a value.

Most components are concerned only with generating HTML. A certain subset of components deal with the

flip-side of requests; handling of incoming requests. Link classes, such as PageLink, DirectLink and

ActionLink, create clickable links in the rendered page and are involved in dispatching to user-supplied

code when such a link is triggered by clicking it.

Other components, Form, and the form control components (TextField, PropertySelection, Checkbox, etc.),

facilitate HTML forms. When such components render, they read properties from application objects so as to

provide default values. When the forms are submitted, the components within the form read HTTP query

parameters, convert the values to appropriate types and then update properties of application objects.

你可能感兴趣的:(html,tapestry)