com.vaadin.flow.server.communication.
Class IndexHtmlRequestHandler
All Implemented Interfaces:
This class is responsible for serving the index.html
according
to the template provided in the frontend folder. The handler will calculate
and inject baseHref as well as the bundle scripts into the template.
For internal use only. May be renamed or removed in a future release.
See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.server.communication.JavaScriptBootstrapHandler
JavaScriptBootstrapHandler.JavaScriptBootstrapContext
Nested classes/interfaces inherited from class com.vaadin.flow.server.BootstrapHandler
BootstrapHandler.BootstrapContext, BootstrapHandler.BootstrapPageBuilder, BootstrapHandler.BootstrapUriResolver, BootstrapHandler.PageBuilder
Nested classes/interfaces inherited from class com.vaadin.flow.server.SynchronizedRequestHandler
SynchronizedRequestHandler.ResponseWriter
-
Field Summary
FieldsFields inherited from class com.vaadin.flow.server.BootstrapHandler
SCRIPT_TAG, SCRIPT_TEMPLATE_FOR_STYLESHEET_LINK_TAG, SERVICE_WORKER_HEADER
Fields inherited from class com.vaadin.flow.server.SynchronizedRequestHandler
MAX_BUFFER_SIZE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
addGeneratedIndexContent
(org.jsoup.nodes.Document targetDocument, elemental.json.JsonObject statsJson) static void
addLicenseChecker
(org.jsoup.nodes.Document indexDocument) Adds the needed overrides for the license checker to work when in development mode.
protected boolean
canHandleRequest
(VaadinRequest request) Check whether a request may be handled by this handler.
protected void
initializeUIWithRouter
(BootstrapHandler.BootstrapContext context, UI ui) boolean
synchronizedHandleRequest
(VaadinSession session, VaadinRequest request, VaadinResponse response) Identical to
SynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
except theVaadinSession
is locked before this is called and unlocked after this has completed.Methods inherited from class com.vaadin.flow.server.communication.JavaScriptBootstrapHandler
createAndInitUI, createBootstrapContext, getInitialJson, getRequestUrl, getServiceUrl
Methods inherited from class com.vaadin.flow.server.BootstrapHandler
getInitialUidl, getPageBuilder, getPushScript, getStatsJson, getStylesheetLinks, getStylesheetTags, getUIClass, isFrameworkInternalRequest, isRequestForHtml, isVaadinStaticFileRequest, readResource, resolvePageTitle, setupErrorDialogs, setupHiddenElement, setupPushConnectionFactory, setupPwa, writeErrorCodeIfRequestLocationIsInvalid
Methods inherited from class com.vaadin.flow.server.SynchronizedRequestHandler
getRequestBody, handleRequest, isReadAndWriteOutsideSessionLock, synchronizedHandleRequest
-
Field Details
-
LIVE_RELOAD_PORT_ATTR
See Also:
-
-
Constructor Details
-
IndexHtmlRequestHandler
public IndexHtmlRequestHandler()
-
-
Method Details
-
synchronizedHandleRequest
public boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException Description copied from class:
SynchronizedRequestHandler
Identical to
SynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
except theVaadinSession
is locked before this is called and unlocked after this has completed.Overrides:
synchronizedHandleRequest
in classJavaScriptBootstrapHandler
Parameters:
session
- The session for the requestrequest
- The request to handleresponse
- The response object to which a response can be written.Returns:
true if a response has been written and no further request handlers should be called, otherwise false
Throws:
IOException
- If an IO error occurredSee Also:
-
addLicenseChecker
public static void addLicenseChecker(org.jsoup.nodes.Document indexDocument) Adds the needed overrides for the license checker to work when in development mode.
-
canHandleRequest
Description copied from class:
SynchronizedRequestHandler
Check whether a request may be handled by this handler. This can be used as an optimization to avoid locking the session just to investigate some method property. The default implementation just returns
true
which means that all requests will be handled by callingSynchronizedRequestHandler.synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)
with the session locked.Overrides:
canHandleRequest
in classJavaScriptBootstrapHandler
Parameters:
request
- the request to handleReturns:
true
if the request handling should continue once the session has been locked;false
if there's no need to lock the session since the request would still not be handled. -
initializeUIWithRouter
Overrides:
-
addGeneratedIndexContent
protected static void addGeneratedIndexContent(org.jsoup.nodes.Document targetDocument, elemental.json.JsonObject statsJson)
-