Children Display |
---|
HTML Comment |
---|
Update here after adding new headings to child pages. Forces a rebuild of the main TOC. A random number: 124c41 |
General Questions
How do I get started with Tapestry?
The easiest way to get started is to use Apache Maven to create your initial project; Maven can use an archetype (a kind of project template) to create a bare-bones Tapestry application for you.
One you have Maven installed, execute the command mvn archetype:generate -DarchetypeCatalog=
http://tapestry.apache.org
. Maven will (after performing a large number of one-time downloads) ask you questions about how to create the new project, including a group id (like a package name) and an artifact id for your new project. Once it is created, you can load it into any IDE and start coding, or use mvn jetty:run
Footnote |
---|
Jetty is a well-known high-performance servlet container. Jetty starts up quickly, and implements the official Servlet specification very closely. |
http://localhost:8080
to run the application.Limitations
How do I add new components to an existing page dynamically?
The short answer here is: you don't. The long answer here is you don't have to, to get the behavior you desire.
One of Tapestry basic values is high scalability: this is expressed in a number of ways, reflecting scalability concerns within a single server, and within a cluster of servers.
Although you code Tapestry pages and components as if they were ordinary POJOs
Footnote |
---|
Plain Old Java Object. Tapestry does not require you to extend any base classes or implement any special interfaces. |
What this means is that any incoming request must be handled by a single page instance. Therefore, Tapestry enforces the concept of static structure, dynamic behavior.
Tapestry provides quite a number of ways to vary what content is rendered, well beyond simple conditionals and loops. It is possible to "drag in" components from other pages when rendering a page (other FAQs will expand on this concept). The point is, that although a Tapestry page's structure is very rigid, the order in which the components of the page render does not have to be top to bottom.
Specific Errors
When I use an HTML entity, such as
in my template, I get a SAXParseException
Tapestry uses a standard SAX parser to read your templates. This means that your templates must be well formed: open and close tags must balance, attribute values must be quoted, and entities must be declared. The easiest way to accomplish this is to add a DOCTYPE to your the top of your template:
...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Part of the DOCTYPE is the declaration of entities such as
.
Alternately, you can simply use the numeric version:  
; This is the exact same character and will render identically in the browser.
—
display-footnotes