A "Swiss Army Knife" component that can emulate any tag whatsoever. The Any component renders the tag for its element in the template, plus any informal parameters, and its body. This is typically used to make certain attributes of a tag dynamic without having to write an entire component for that single purpose.

See also: org.apache.tapestry.components.Any , If , For


Name Type Required Default Description
element string no From the HTML template The element to render.

Body: allowed

Informal parameters: allowed

Reserved parameters: none

Certain other components, including If and For , can behave much like an Any component, in addition to their normal behavior, by specifying a value for their element parameter.


In this example, the Any component is emulating an <img> element, and is dynamically calculating the URL, width, height, and title from data (presumably obtained from a database).


<span jwcid="loop">
    <img jwcid="@Any" src="ognl:image.thumbURL" width="ognl:image.thumbWidth" height="ognl:image.thumbHeight"
    <span jwcid="@Insert" value="ognl:image.title"/>

This template is complemented by some details in the specification:

  . . .
  <property name="image"/>
  <component id="loop" type="For">
    <binding name="source" value="thumbnails"/>
    <binding name="value" value="image"/>
  . . .

The RenderBlock component contains an extensive example that includes the use of the Any component.