Search in sources :

Example 1 with UidlWriter

use of com.vaadin.flow.server.communication.UidlWriter in project flow by vaadin.

the class BootstrapHandler method getInitialUidl.

/**
 * Generates the initial UIDL message which is included in the initial
 * bootstrap page.
 *
 * @param ui
 *            the UI for which the UIDL should be generated
 * @return a JSON object with the initial UIDL message
 */
protected static JsonObject getInitialUidl(UI ui) {
    JsonObject json = new UidlWriter().createUidl(ui, false);
    VaadinSession session = ui.getSession();
    if (session.getConfiguration().isXsrfProtectionEnabled()) {
        writeSecurityKeyUIDL(json, ui);
    }
    writePushIdUIDL(json, session);
    if (getLogger().isDebugEnabled()) {
        getLogger().debug("Initial UIDL: {}", json.asString());
    }
    return json;
}
Also used : UidlWriter(com.vaadin.flow.server.communication.UidlWriter) JsonObject(elemental.json.JsonObject)

Aggregations

UidlWriter (com.vaadin.flow.server.communication.UidlWriter)1 JsonObject (elemental.json.JsonObject)1