|
Summary
Definitions
Overview
Illustration 1
Page Template
Page Specification
Page Class
-Application Specification
web.xml
Illustration 2
Illustration 3
The Framework - a flyby
Conclusion
Biography
Resources
|
Application Specification
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<application name="Tapestry Illustration 1">
<page name="Home" specification-path="Home.page"/>
</application>
Listing 4. Welcome.application
The application specification to an application is like the component
specification to a component; it ties the pieces of an application
together. It specifies, among other things, the Pages that make the
application. The specification root element,
<application>, has a name attribute that can
be used to specify an optional descriptive name for the application as
shown in the Welcome application. In our example one-page Welcome
application, the Home Page component is declared using the
<Page> element within the <application>
element. The <page> element has two attributes
namely name and specification-path. The
name attribute is used to specify a logical name for the
Page component, which is typically the same as the principal physical
name (Home part of Home.page in our example)
of the component specification. The logical name for the Page component
can be any identifier unique within an application. Although the name
Home (exact case) has a special meaning in Tapestry. The
framework will forward all unknown requests to the Page component named
Home. The specification-path attribute is
used to specify the physical name and location of the Page component
specification relative to the current location (location of the
application specification file). This is the only place one has to
specify the physical path to the file; all other references to the
component are specified using the logical name thus isolating the
physical name and location changes.
The naming convention for the application specification is the
application context name with an extension of application.
And thus the specification for our Welcome application is named
Welcome.application. As mentioned before, specifications are
typically placed under the WEB-INF folder of the
application context. So, if Welcome is the context of our
Welcome application, Welcome.application will typically be
placed under webapps/Welcome/WEB-INF.
|