public final class RsVelocity extends RsWrap
This response implementation is rendering a page from Apache Velocity template. Here is how you can use it:
public final class TkHelp implements Take {
@Override
public Response act(final Request req) {
return new RsHTML(
new RsVelocity(
this.getClass().getResource("help.html.vm"),
new RsVelocity.Pair("name", "Jeffrey")
)
);
}
}
The class is immutable and thread-safe.
| Modifier and Type | Class and Description |
|---|---|
static class |
RsVelocity.Pair
Pair of values.
|
| Constructor and Description |
|---|
RsVelocity(CharSequence template,
RsVelocity.Pair... params)
Ctor.
|
RsVelocity(InputStream template,
Map<CharSequence,Object> params)
Ctor.
|
RsVelocity(InputStream template,
RsVelocity.Pair... params)
Ctor.
|
RsVelocity(String folder,
InputStream template,
Map<CharSequence,Object> params)
Ctor.
|
RsVelocity(URL template,
RsVelocity.Pair... params)
Ctor.
|
public RsVelocity(CharSequence template, RsVelocity.Pair... params)
template - Templateparams - List of paramspublic RsVelocity(URL template, RsVelocity.Pair... params) throws IOException
template - Templateparams - List of paramsIOException - If failspublic RsVelocity(InputStream template, RsVelocity.Pair... params)
template - Templateparams - Entriespublic RsVelocity(InputStream template, Map<CharSequence,Object> params)
template - Templateparams - Map of paramspublic RsVelocity(String folder, InputStream template, Map<CharSequence,Object> params)
folder - Template foldertemplate - Templateparams - Map of paramsCopyright © 2015–2018 Take. All rights reserved.