public class VelocityPage extends java.lang.Object implements Page
Page
implementation which can handle Velocity-templates
set(String, Object)
Formatter
instanceThreadContext.getThreadPrincipal()
ThreadContext.getThreadRequest()
Configuration.get()
Constructor and Description |
---|
VelocityPage()
if you use this constructor, you have to call
setTemplate(String) |
VelocityPage(java.lang.String resource)
loads the given
template . the Resource to use will be determined automatically |
Modifier and Type | Method and Description |
---|---|
void |
addHeader(java.lang.String header,
java.util.Date value) |
void |
addHeader(java.lang.String header,
int value) |
void |
addHeader(java.lang.String header,
java.lang.String value) |
java.lang.String |
getContentType()
Returns the content type of the page, for example "text/html".
|
java.util.List<Pair<java.lang.String,java.lang.Object>> |
getHeaders()
Returns the list of http-response-headers to be set on the
HttpServletResponse |
void |
set(java.lang.String name,
java.lang.Object obj)
adds the given object to the
VelocityContext |
void |
setContentType(java.lang.String contentType)
set the contenttype
|
void |
setTemplate(java.lang.String template)
set the velocity-template
|
java.lang.String |
show()
Called from the Dispatcher.
|
public VelocityPage()
setTemplate(String)
public VelocityPage(java.lang.String resource)
template
. the Resource
to use will be determined automaticallyresource
- the velocity templatepublic void set(java.lang.String name, java.lang.Object obj)
VelocityContext
name
- variable nameobj
- objectpublic java.lang.String show()
Page
public java.lang.String getContentType()
Page
getContentType
in interface Page
public void setTemplate(java.lang.String template)
template
- a string containing velocity-syntaxpublic void setContentType(java.lang.String contentType)
contentType
- the contenttypepublic java.util.List<Pair<java.lang.String,java.lang.Object>> getHeaders()
Page
HttpServletResponse
getHeaders
in interface Page
String
, Date
or Integer
public void addHeader(java.lang.String header, java.lang.String value)
public void addHeader(java.lang.String header, java.util.Date value)
public void addHeader(java.lang.String header, int value)
@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.