Home - Internet Technologies - For Developers - How does it work? - T - Tapestry Internals

After the Storm - Internet Technologies

Home
Internet Technologies
For Developers
How does it work?
B
E
J
S
T
Tapestry Internals
W

Tapestry Internals

Tapestry builds on the mantra "don't learn another scripting language, use Java". While ASP, JSP, PHP, Velocity etc. - as good as they might be - can be used for programmatically creating web content, these systems require to learn a scripting language that is used to access application logic from within a web document.

To use Tapestry you first produce plain HTML. HTML tags that are later to be exchanged with program output get a jwcid attribute. This refers to a component defined in a jwc file. A component has a type which is a Java bean. Component bindings define which property of the component gets mapped to which value.

Since a value can be an expression and an expression can refer to the property of another bean, this concept is pretty flexible. When the template = HTML file is rendered, the renderComponent() method is called on the components and the result is inserted into the output.

More magic happens behind the scenes. In example, components are context-sensitive. Just by placing a prefab rollover button component within a link tag, the button will be enabled depending on whether the link is enabled or not.

One of the biggest pains with Web-based GUIs is handling user interaction events, in example when the user selects an entry in a drop down box, or unchecks an option. Normally, this would require some JavaScript, encoding of an URL which specifies the source component and the event, programming a handler servlet that routes events to components, and some more code to handle components within a page and session.


© 1998-2005 Christian Treber, ct@ctreber.com. All rights reserved. The author takes no responsability for linked external pages, the content of which by no means reflect his own opinion, convictions etc.