You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.
Add custom BootstrapListener that modifies the main page, e.g.:
import com.vaadin.server.BootstrapFragmentResponse;
import com.vaadin.server.BootstrapListener;
import com.vaadin.server.BootstrapPageResponse;
import org.jsoup.nodes.Element;
import org.springframework.stereotype.Component;
@Component(CustomBootstrapListener.NAME)
public class CustomBootstrapListener implements BootstrapListener {
public static final String NAME = "demo_BootstrapListener";
@Override
public void modifyBootstrapFragment(BootstrapFragmentResponse response) {
}
@Override
public void modifyBootstrapPage(BootstrapPageResponse response) {
Element head = response.getDocument().getElementsByTag("head").get(0);
Element meta = response.getDocument().createElement("meta");
meta.attr("name", "viewport");
meta.attr("content", "width=device-width, initial-scale=" + 0.8);
head.appendChild(meta);
}
}
Check result:
The text was updated successfully, but these errors were encountered:
For QA:
Add custom
BootstrapListener
that modifies the main page, e.g.:Check result:
The text was updated successfully, but these errors were encountered: