public class HTMLPage extends Object implements Page, Serializable
Modifier and Type | Field and Description |
---|---|
protected String |
contentType |
protected String |
page |
Constructor and Description |
---|
HTMLPage()
This class can be used to construct HTML pages from templates and values.
|
HTMLPage(String resource)
Creates a HTMLPage with a content loaded from a file in classpath.
|
HTMLPage(String resource,
Resource res)
Creates a HTMLPage with a content loaded from a file in classpath.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String header,
Date value)
Set a header field in the response before writing the page.
|
void |
addHeader(String header,
int value)
Set a header field in the response before writing the page.
|
void |
addHeader(String header,
String value)
Set a header field in the response before writing the page.
|
String |
getContentType()
This method returns the content type.
|
List<Pair<String,Object>> |
getHeaders()
Returns the list of http-response-headers to be set on the
HttpServletResponse |
void |
setContentType(String type)
Set the content type.
|
void |
setMask(String s)
Deprecated.
|
HTMLPage |
setPage(String s)
Set the content of the page.
|
String |
show()
This method returns the page contents.
|
void |
substEncoded(String field,
String value)
Substitutes the field named by the first argument with the second argument.
|
void |
substitute(String field,
long value)
Substitutes the field named by the first argument with the second argument.
|
void |
substitute(String field,
Object value)
Substitutes the field named by the first argument with the second argument.
|
void |
substitute(String field,
String value)
Substitutes the field named by the first argument with the second argument.
|
public HTMLPage()
public HTMLPage(String resource)
public HTMLPage setPage(String s)
s
- the content of the pagepublic void substitute(String field, String value)
field
- the place-holdervalue
- the value to be insertedpublic void substEncoded(String field, String value)
field
- the place-holdervalue
- the value to be insertedpublic void substitute(String field, long value)
field
- the place-holdervalue
- the value to be insertedpublic void substitute(String field, Object value)
field
- the place-holdervalue
- the value to be inserted, toString is called on the object.public String show()
public String getContentType()
getContentType
in interface Page
public void setContentType(String type)
type
- the content type, for example "text/plain"@Deprecated public void setMask(String s)
s
- the template of the pagepublic List<Pair<String,Object>> getHeaders()
Page
HttpServletResponse
getHeaders
in interface Page
String
, Date
or Integer
public void addHeader(String header, String value)
HttpServletResponse.setHeader(String, String)
will be used to set to the new value.header
- the name of the headervalue
- the header valuepublic void addHeader(String header, Date value)
HttpServletResponse.setDateHeader(String,long)
will be used to set to the new value.header
- the name of the headervalue
- the header valuepublic void addHeader(String header, int value)
HttpServletResponse.setIntHeader(String,int)
will be used to set to the new value.header
- the name of the headervalue
- the header value@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.