Every component has a component specification, a file ending in .jwc
whose
root element is <component-specification>
.
Each component's specification defines the basic characteristics of the component:
The Java class for the component (which defaults to BaseComponent
)
Whether the component uses its body, or discards it (the allow-body
attribute,
which defaults to yes
)
The name, type and other information for each formal parameter.
Whether the component allows informal parameters or discards them
(the allow-informal-parameters
attribute, which defaults to
yes
)
The names of any reserved parameters which may not be used as informal parameters.
Beyond those additions, a component specification is otherwise the same as a <page-specification>
.
When a component is referenced in an HTML template (using the @
syntax), or in a specification (as the Type
type
attribute of
a <component>
element), Tapestry must locate and parse the component's specification (this is only done once, with the
result cached for later).
Tapestry searches for components in the following places:
As specified in a <component-type>
element (with the application specification)
In the same folder (typically, WEB-INF
) as the
application specification
In the WEB-INF/
folder
(servlet-name
servlet-name
is the name of the Tapestry ApplicationServlet
for the application)
[3]
In the WEB-INF
folder
In the root context directory
Generally, the correct place is in the
WEB-INF
folder. Components packaged into
libraries have a different (and simpler) search.
[3] This is a very rare option that will only occur when a single WAR file contains multiple Tapestry applications.