public interface Headers
It is important to note that "headlines" must be added in the preparePaint phase. Headlines adding in serviceRequest will be lost because the headers are reset at the start of preparePaint. Adding headlines in the paint phase is too late as the headers have already been written. Note also that it would be possible to make the adding of headlines work for the paint phase, but at the expense of requiring the entire body of the page to be cached.
Modifier and Type | Field and Description |
---|---|
static String |
CSS_HEADLINE
CSS headline.
|
static String |
JAVASCRIPT_HEADLINE
Javascript headline.
|
static String |
UNTYPED_HEADLINE
Untyped headline.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeadLine(String aLine)
Records a "shared" line for inclusion in the output.
|
void |
addHeadLine(String type,
String aLine)
Records a "shared" line (of a specified type) for inclusion in the output.
|
void |
addUniqueHeadLine(String aLine)
Records a line for inclusion in the html/head, if it has not already been included.
|
void |
addUniqueHeadLine(String type,
String aLine)
Records a "shared" line (of a specified type) for inclusion in the output, if it has not already been included.
|
String |
getContentType()
Get the content type (usually text/html).
|
List |
getHeadLines() |
List |
getHeadLines(String type)
Get the head lines, of a specified type.
|
void |
reset()
Called by the servlet between service requests.
|
void |
setContentType(String type)
Set the content type (usually text/html).
|
static final String UNTYPED_HEADLINE
static final String JAVASCRIPT_HEADLINE
static final String CSS_HEADLINE
void reset()
void addHeadLine(String aLine)
aLine
- the line to add.void addHeadLine(String type, String aLine)
type
- the type of line to add.aLine
- the line to add.void addUniqueHeadLine(String aLine)
aLine
- the line to add.void addUniqueHeadLine(String type, String aLine)
An example of where this is useful is for adding shared JavaScript code.
type
- the type of line to add.aLine
- the line to add.List getHeadLines()
List getHeadLines(String type)
type
- the type of headlines to return.String getContentType()
void setContentType(String type)
type
- The content type to set on the response.Copyright © 2021. All rights reserved.