public class JavaScriptBootstrapHandler extends BootstrapHandler
The handler is for client driven projects where `index.html` does not contain bootstrap data. Bootstraping is the responsability of the `@vaadin/flow` client that is able to ask the server side to create the vaadin session and do the boostrapping lazily.
For internal use only. May be renamed or removed in a future release.
| Modifier and Type | Class and Description |
|---|---|
static class |
JavaScriptBootstrapHandler.JavaScriptBootstrapContext
Custom BootstrapContext for
JavaScriptBootstrapHandler. |
BootstrapHandler.BootstrapContext, BootstrapHandler.BootstrapPageBuilder, BootstrapHandler.BootstrapUriResolver, BootstrapHandler.PageBuilderSERVICE_WORKER_HEADER| Constructor and Description |
|---|
JavaScriptBootstrapHandler()
Creates a new bootstrap handler with default page builder.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canHandleRequest(VaadinRequest request)
Check whether a request may be handled by this handler.
|
protected BootstrapHandler.BootstrapContext |
createAndInitUI(Class<? extends UI> uiClass,
VaadinRequest request,
VaadinResponse response,
VaadinSession session) |
protected BootstrapHandler.BootstrapContext |
createBootstrapContext(VaadinRequest request,
VaadinResponse response,
UI ui,
Function<VaadinRequest,String> callback)
|
protected elemental.json.JsonObject |
getInitialJson(VaadinRequest request,
VaadinResponse response,
VaadinSession session)
Returns the JSON object with the application config and UIDL info that
can be used in the bootstrapper to embed that info in the initial page.
|
protected String |
getRequestUrl(VaadinRequest request) |
protected static String |
getServiceUrl(VaadinRequest vaadinRequest)
Gets the service URL as a URL relative to the request URI.
|
protected void |
initializeUIWithRouter(BootstrapHandler.BootstrapContext context,
UI ui) |
boolean |
synchronizedHandleRequest(VaadinSession session,
VaadinRequest request,
VaadinResponse response)
Identical to
SynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
except the VaadinSession is locked before this is called and
unlocked after this has completed. |
getInitialUidl, getPageBuilder, getPushScript, getUIClass, isFrameworkInternalRequest, readResource, resolvePageTitle, setupErrorDialogs, setupPushConnectionFactory, setupPwa, showWebpackErrors, writeErrorCodeIfRequestLocationIsInvalidhandleRequestpublic JavaScriptBootstrapHandler()
protected boolean canHandleRequest(VaadinRequest request)
SynchronizedRequestHandlertrue which means that all requests will be handled by
calling
SynchronizedRequestHandler.synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)
with the session locked.canHandleRequest in class BootstrapHandlerrequest - the request to handletrue 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.protected String getRequestUrl(VaadinRequest request)
protected BootstrapHandler.BootstrapContext createAndInitUI(Class<? extends UI> uiClass, VaadinRequest request, VaadinResponse response, VaadinSession session)
createAndInitUI in class BootstrapHandlerprotected void initializeUIWithRouter(BootstrapHandler.BootstrapContext context, UI ui)
initializeUIWithRouter in class BootstrapHandlerprotected BootstrapHandler.BootstrapContext createBootstrapContext(VaadinRequest request, VaadinResponse response, UI ui, Function<VaadinRequest,String> callback)
BootstrapHandlercreateBootstrapContext in class BootstrapHandlerrequest - the request objectresponse - the response objectui - the UI objectpublic boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException
SynchronizedRequestHandlerSynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
except the VaadinSession is locked before this is called and
unlocked after this has completed.synchronizedHandleRequest in class BootstrapHandlersession - The session for the requestrequest - The request to handleresponse - The response object to which a response can be written.IOException - If an IO error occurredSynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)protected static String getServiceUrl(VaadinRequest vaadinRequest)
vaadinRequest - the requestprotected elemental.json.JsonObject getInitialJson(VaadinRequest request, VaadinResponse response, VaadinSession session)
request - the vaadin request.response - the response.session - the vaadin session.Copyright © 2000–2022 Vaadin Ltd. All rights reserved.