Class IndexHtmlRequestHandler
java.lang.Object
com.vaadin.flow.server.SynchronizedRequestHandler
com.vaadin.flow.server.BootstrapHandler
com.vaadin.flow.server.communication.JavaScriptBootstrapHandler
com.vaadin.flow.server.communication.IndexHtmlRequestHandler
- All Implemented Interfaces:
RequestHandler,Serializable
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.JavaScriptBootstrapContextNested classes/interfaces inherited from class com.vaadin.flow.server.BootstrapHandler
BootstrapHandler.BootstrapContext, BootstrapHandler.BootstrapPageBuilder, BootstrapHandler.BootstrapUriResolver, BootstrapHandler.PageBuilderNested 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_HEADERFields inherited from class com.vaadin.flow.server.SynchronizedRequestHandler
MAX_BUFFER_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddGeneratedIndexContent(org.jsoup.nodes.Document targetDocument, com.fasterxml.jackson.databind.node.ObjectNode statsJson) static voidaddLicenseChecker(org.jsoup.nodes.Document indexDocument) Adds the needed overrides for the license checker to work when in development mode.protected booleancanHandleRequest(VaadinRequest request) Check whether a request may be handled by this handler.protected voidinitializeUIWithRouter(BootstrapHandler.BootstrapContext context, UI ui) booleansynchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) Identical toSynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)except theVaadinSessionis 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, getServiceUrlMethods inherited from class com.vaadin.flow.server.BootstrapHandler
getInitialUidl, getPageBuilder, getPushScript, getStatsJson, getStylesheetLinks, getStylesheetLinks, getStylesheetTags, getUIClass, isFrameworkInternalRequest, isRequestForHtml, isVaadinStaticFileRequest, readResource, resolvePageTitle, setupErrorDialogs, setupHiddenElement, setupPushConnectionFactory, setupPwa, writeErrorCodeIfRequestLocationIsInvalidMethods 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:SynchronizedRequestHandlerIdentical toSynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)except theVaadinSessionis locked before this is called and unlocked after this has completed.- Overrides:
synchronizedHandleRequestin 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 occurred- See 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:SynchronizedRequestHandlerCheck 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 returnstruewhich means that all requests will be handled by callingSynchronizedRequestHandler.synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)with the session locked.- Overrides:
canHandleRequestin classJavaScriptBootstrapHandler- Parameters:
request- the request to handle- Returns:
trueif the request handling should continue once the session has been locked;falseif there's no need to lock the session since the request would still not be handled.
-
initializeUIWithRouter
- Overrides:
initializeUIWithRouterin classJavaScriptBootstrapHandler
-
addGeneratedIndexContent
protected static void addGeneratedIndexContent(org.jsoup.nodes.Document targetDocument, com.fasterxml.jackson.databind.node.ObjectNode statsJson)
-