Package com.groiss.gui
Class HTMLPage
java.lang.Object
com.groiss.gui.HTMLPage
- All Implemented Interfaces:
Page
,Serializable
- Direct Known Subclasses:
ActionPage
,HTMLTree
An object representing an HTML page.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Set a header field in the response before writing the page.void
Set a header field in the response before writing the page.void
Set a header field in the response before writing the page.This method returns the content type.Returns the list of http-response-headers to be set on theHttpServletResponse
void
setContentType
(String type) Set the content type.void
Deprecated.Set the content of the page.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.
-
Field Details
-
page
-
contentType
-
-
Constructor Details
-
HTMLPage
public HTMLPage()Empty constructor, use setPage to fill the content. -
HTMLPage
Creates a HTMLPage with a content loaded from a file in classpath. The required resource bundle will be determined automatically. -
HTMLPage
Creates a HTMLPage with a content loaded from a file in classpath.
-
-
Method Details
-
setPage
Set the content of the page.- Parameters:
s
- the content of the page
-
substitute
Substitutes the field named by the first argument with the second argument.- Parameters:
field
- the place-holdervalue
- the value to be inserted
-
substEncoded
Substitutes the field named by the first argument with the second argument. The value will be html-encoded.- Parameters:
field
- the place-holdervalue
- the value to be inserted
-
substitute
Substitutes the field named by the first argument with the second argument.- Parameters:
field
- the place-holdervalue
- the value to be inserted
-
substitute
Substitutes the field named by the first argument with the second argument.- Parameters:
field
- the place-holdervalue
- the value to be inserted, toString is called on the object.
-
show
This method returns the page contents. -
getContentType
This method returns the content type. If not set, the value "text/html" is returned.- Specified by:
getContentType
in interfacePage
- Returns:
- the content type of the page.
-
setContentType
Set the content type.- Parameters:
type
- the content type, for example "text/plain"
-
setMask
Deprecated.Set the mask template of the page. This method does the same as setPage() and is provided for compatibility.- Parameters:
s
- the template of the page
-
getHeaders
Description copied from interface:Page
Returns the list of http-response-headers to be set on theHttpServletResponse
- Specified by:
getHeaders
in interfacePage
- Returns:
- the http-headers (the value may be one of
String
,Date
orInteger
-
addHeader
Set a header field in the response before writing the page. Please note thatHttpServletResponse.setHeader(String, String)
will be used to set to the new value.- Parameters:
header
- the name of the headervalue
- the header value
-
addHeader
Set a header field in the response before writing the page. Please note thatHttpServletResponse.setDateHeader(String,long)
will be used to set to the new value.- Parameters:
header
- the name of the headervalue
- the header value
-
addHeader
Set a header field in the response before writing the page. Please note thatHttpServletResponse.setIntHeader(String,int)
will be used to set to the new value.- Parameters:
header
- the name of the headervalue
- the header value
-