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.PageBuilder
SERVICE_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, writeErrorCodeIfRequestLocationIsInvalid
handleRequest
public JavaScriptBootstrapHandler()
protected boolean canHandleRequest(VaadinRequest request)
SynchronizedRequestHandler
true
which means that all requests will be handled by
calling
SynchronizedRequestHandler.synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)
with the session locked.canHandleRequest
in class BootstrapHandler
request
- 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 BootstrapHandler
protected void initializeUIWithRouter(BootstrapHandler.BootstrapContext context, UI ui)
initializeUIWithRouter
in class BootstrapHandler
protected BootstrapHandler.BootstrapContext createBootstrapContext(VaadinRequest request, VaadinResponse response, UI ui, Function<VaadinRequest,String> callback)
BootstrapHandler
createBootstrapContext
in class BootstrapHandler
request
- the request objectresponse
- the response objectui
- the UI objectpublic boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException
SynchronizedRequestHandler
SynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
except the VaadinSession
is locked before this is called and
unlocked after this has completed.synchronizedHandleRequest
in class BootstrapHandler
session
- 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 © 2022. All rights reserved.