List of usage examples for com.vaadin.server VaadinRequest getContextPath
public String getContextPath();
From source file:org.vaadin.tori.ToriApiLoader.java
License:Apache License
private static String getToriThemeImagesURL(final VaadinRequest request) throws MalformedURLException { URL url = Page.getCurrent().getLocation().toURL(); int port = url.getPort(); if (url.getProtocol().equals("http") && port == 80) { port = -1;// ww w .j a va 2s .c o m } else if (url.getProtocol().equals("https") && port == 443) { port = -1; } URL serverURL = new URL(url.getProtocol(), url.getHost(), port, ""); String contextPath = request.getContextPath(); String imagesPath = "/VAADIN/themes/tori/images/"; return serverURL + contextPath + imagesPath; }