Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The renderComponent method gets a mutable copy of the next Tag in the
markup stream for the component and calls onComponentTag(Tag) to allow
the subclass to modify the tag. Once the subclass has changed the
tag, it is written out to the Response with renderComponentTag(Tag)
and the markup stream is advanced to the next tag. Next
onComponentTagBody() is called, passing in the MarkupStream and the
ComponentTag that was written out as the opening tag. This allows the
component to do whatever it needs to do to produce a body for the
component tag. One operation the subclass can call in
onComponentTagBody() is Component.replaceComponentTagBody(), which
replaces the markup inside the component's body with an arbtirary
String. Finally, the framework writes out any appropriate closing tag
for the component's open tag.

Rendering to a string

For rendering a complete page to a string, see this article.

For rendering just a Panel to a string, see this entry.