Jakarta > Tapestry
Jakarta
 

Else

Conditionally emulates an element and its attributes and/or includes a block of content if the condition of the previous If component evaluates to false.

See also: org.apache.tapestry.components.ElseBean, If, Conditional

Parameters

Name Type Direction Required Default Description
element String in no   The element to emulate. If specified, then the component acts like an Any, emitting an open and close tag. Informal parameters are applied to the tag. If no element is specified, informal parameters are ignored.

Body: allowed

Informal parameters: allowed

Reserved parameters: none

Examples

In the example, we say hello to our user if he/she has login, or we ask him/her login. (Just the same example for If component.)

Home.html

...
<p>
Hello, <span jwcid="@If" condition="ognl:user.login"><span jwcid="@Insert" value="ognl:user.name"/></span>
<span jwcid="@Else"> please <span jwcid="@PageLink" page="Login">login</span></span>	
</p>
...