com.vaadin.flow.server.
Class BootstrapPageResponse
- java.lang.Object
-
- com.vaadin.flow.server.BootstrapPageResponse
-
public class BootstrapPageResponse extends Object
This represents the state of a bootstrap page being generated. The bootstrap page contains of the full DOM of the HTML document as well as the HTTP headers that will be included in the corresponding HTTP response.
Since:
1.0
Author:
Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor and Description BootstrapPageResponse(VaadinRequest request, VaadinSession session, VaadinResponse response, org.jsoup.nodes.Document document, UI ui, VaadinUriResolver uriResolver)
Create a new bootstrap page response.
-
Method Summary
All Methods Modifier and Type Method and Description org.jsoup.nodes.Document
getDocument()
Gets the document node representing the root of the DOM hierarchy that will be used to generate the HTML page.
VaadinRequest
getRequest()
Gets the request for which the generated bootstrap HTML will be the response.
VaadinResponse
getResponse()
Gets the HTTP response that serves the bootstrap page.
VaadinSession
getSession()
Gets the service session to which the rendered view belongs.
UI
getUI()
Gets the UI that will be displayed on the generated bootstrap page.
VaadinUriResolver
getUriResolver()
Gets the URI resolver utility.
void
setDateHeader(String name, long timestamp)
Properly formats a timestamp as a date in a header that will be included in the HTTP response.
void
setHeader(String name, String value)
Sets a header value that will be added to the HTTP response.
-
-
-
Constructor Detail
-
BootstrapPageResponse
public BootstrapPageResponse(VaadinRequest request, VaadinSession session, VaadinResponse response, org.jsoup.nodes.Document document, UI ui, VaadinUriResolver uriResolver)
Create a new bootstrap page response.
Parameters:
request
- the Vaadin request for which the bootstrap page should be generated.session
- the service session for which the bootstrap page should be generated.response
- the Vaadin response that serves the bootstrap page.document
- the DOM document making up the HTML page.uriResolver
- the uri resolver utilityui
- the UI for the bootstrap.
-
-
Method Detail
-
getResponse
public VaadinResponse getResponse()
Gets the HTTP response that serves the bootstrap page.
Returns:
the Vaadin response.
-
setHeader
public void setHeader(String name, String value)
Sets a header value that will be added to the HTTP response. If the header had already been set, the new value overwrites the previous one.
Parameters:
name
- the name of the header.value
- the header value.See Also:
-
setDateHeader
public void setDateHeader(String name, long timestamp)
Properly formats a timestamp as a date in a header that will be included in the HTTP response. If the header had already been set, the new value overwrites the previous one.
Parameters:
name
- the name of the header.timestamp
- the number of milliseconds since epoch.See Also:
setHeader(String, String)
,VaadinResponse.setDateHeader(String, long)
-
getDocument
public org.jsoup.nodes.Document getDocument()
Gets the document node representing the root of the DOM hierarchy that will be used to generate the HTML page. Changes to the document will be reflected in the HTML.
Returns:
the document node.
-
getRequest
public VaadinRequest getRequest()
Gets the request for which the generated bootstrap HTML will be the response. This can be used to read request headers and other additional information.
Returns:
the Vaadin request that is being handled
-
getSession
public VaadinSession getSession()
Gets the service session to which the rendered view belongs.
Returns:
the Vaadin service session
-
getUI
public UI getUI()
Gets the UI that will be displayed on the generated bootstrap page.
Returns:
the UI
-
getUriResolver
public VaadinUriResolver getUriResolver()
Gets the URI resolver utility.
Returns:
the URI resolver utility
-
-