public class HTMLPage extends java.lang.Object implements Page, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
contentType |
protected java.lang.String |
page |
Constructor and Description |
---|
HTMLPage()
This class can be used to construct HTML pages from templates and values.
|
HTMLPage(java.lang.String resource)
Creates a HTMLPage with a content loaded from a file in classpath.
|
HTMLPage(java.lang.String resource,
Resource res)
Creates a HTMLPage with a content loaded from a file in classpath.
|
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()
This method returns the content type.
|
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 |
setContentType(java.lang.String type)
Set the content type.
|
void |
setMask(java.lang.String s)
Deprecated.
|
HTMLPage |
setPage(java.lang.String s)
Set the content of the page.
|
java.lang.String |
show()
This method returns the page contents.
|
void |
substEncoded(java.lang.String field,
java.lang.String value)
Substitutes the field named by the first argument with the second argument.
|
void |
substitute(java.lang.String field,
long value)
Substitutes the field named by the first argument with the second argument.
|
void |
substitute(java.lang.String field,
java.lang.Object value)
Substitutes the field named by the first argument with the second argument.
|
void |
substitute(java.lang.String field,
java.lang.String value)
Substitutes the field named by the first argument with the second argument.
|
protected java.lang.String page
protected java.lang.String contentType
public HTMLPage()
public HTMLPage(java.lang.String resource)
public HTMLPage(java.lang.String resource, Resource res)
public HTMLPage setPage(java.lang.String s)
s
- the content of the pagepublic void substitute(java.lang.String field, java.lang.String value)
field
- the place-holdervalue
- the value to be insertedpublic void substEncoded(java.lang.String field, java.lang.String value)
field
- the place-holdervalue
- the value to be insertedpublic void substitute(java.lang.String field, long value)
field
- the place-holdervalue
- the value to be insertedpublic void substitute(java.lang.String field, java.lang.Object value)
field
- the place-holdervalue
- the value to be inserted, toString is called on the object.public java.lang.String show()
public java.lang.String getContentType()
getContentType
in interface Page
public void setContentType(java.lang.String type)
type
- the content type, for example "text/plain"@Deprecated public void setMask(java.lang.String s)
s
- the template of the pagepublic 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.