C H A P T E R  27

content


<jato:content>

Denotes a section of JSP content that has begin<name>Display() and end<name>Display() events associated with it. The association of these events works in the same way as for visual tags, except that there need be no peer by the specified name in the parent container view.

The entire body content of this tag may be conditionally suppressed by returning a value of false from the corresponding begin<name>Display() event. If the body content is not suppressed, the processed body content will be provided to the end<name>Display() event. The body content will be fully processed, including any embedded JSP or JATO tags, before being passed to this event.

Unlike the firing of display events for the visual tags, which may be suppressed by a combination of attributes on the tag itself or its parent tag, the firing of display events for this tag always occurs. Therefore, for efficiency reasons, developers should always implement at least one of the display events for a content tag--if no events are implemented, there is no reason to use the tag.

This tag is only valid when enclosed by a useViewBean, containerView, or tiledView tag.

Example:

...

Username: <jato:textField name="username"/>

<jato:content name="superuser">

<br>

Password: <jato:textField name="password"/>

</jato:content>

<hr>

...

The above would be rendered into the following HTML if and only if the beginSuperuserDisplay() event in the current parent view returned true:

...

Username: <input type="text" name="PageFoo.username" value="scott">

<br>

Password: <input type="text" name="PageFoo.password" value="tiger">

<hr>

...

The endSuperuserDisplay() event would receive the following HTML as a method parameter:

<br>

Password: <input type="text" name="PageFoo.password" value="tiger">

If the beginSuperuserDisplay() event instead returned false, the following would be rendered:

...

Username: <input type="text" name="PageFoo.username" value="scott">

<hr>

...

The endSuperuserDisplay() event would not be invoked.

Attribute Name

Description

Notes

name

The name of the content section, used to fire display events in the current parent view.

Req