public interface PartialTemplateRenderer
Block
s (<t:block>
in the template),
component instances and RenderCommand
s to a String
or
org.apache.tapestry5.dom.Document
in a programatic way.
This service was created for situations in which a page or component needs to generate some markup
that wouldn't be rendered normally, but for external use, such as e-mails, returning
HTML for AJAX requests or passing HTML instead of plain string for an Alert
.
The name of this interface comes from TAP5-938:
Expose ability to render a portion of a page (a Block, Component, etc.) without using internal services.Modifier and Type | Method and Description |
---|---|
String |
render(Object object)
Renders an object, probably a
Block or component instance, to a string. |
Document |
renderAsDocument(Object object)
Renders an object to a
Document following the same rules as render(Object)
This method supposes any kind of initialization needed
was already done. |
String render(Object object)
Block
or component instance, to a string.
This method supposes any kind of initialization needed
was already done. CSS and JavaScript inclusions or importings are ignored.
The object must implement RenderCommand
or being able to be coerced to it
by TypeCoercer
.object
- an object, probably a Block
or component instance or RenderCommand
.IllegalArgumentException
- if the object isn't a RenderCommand
and cannot be coerced to it by TypeCoercer
.Document renderAsDocument(Object object)
Document
following the same rules as render(Object)
This method supposes any kind of initialization needed
was already done. CSS and JavaScript inclusions or importings are ignored.object
- to render, a RenderCommand
, or coercible to oneDocument
.5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.