/** * @param path path relative to the root of webapp * @return Full absolute path including protocol, domain and webapp prefix */ public String composeFullAbsolutePath(String path) { String webAppUrl = configuration.getConfig(GlobalConfig.class).getWebAppUrl(); webAppUrl = StringUtils.chomp(webAppUrl, "/"); //remove last slash return path.startsWith("/") ? webAppUrl.concat(path) : webAppUrl.concat("/").concat(path); }
public static String getControllerURL(String mapping) { if (mapping == null) throw new IllegalArgumentException("Mapping cannot be null"); Configuration configuration = AppBeans.get(Configuration.NAME); GlobalConfig globalConfig = configuration.getConfig(GlobalConfig.class); StringBuilder sb = new StringBuilder(globalConfig.getWebAppUrl()).append(getControllerPrefix()); if (!mapping.startsWith("/")) { sb.append("/"); } sb.append(mapping); return sb.toString(); }
protected String resolveServerPrefix(String uri) { Configuration configStorage = AppBeans.get(Configuration.NAME); GlobalConfig globalConfig = configStorage.getConfig(GlobalConfig.class); String coreUrl = String.format("http://%s:%s/%s/", globalConfig.getWebHostName(), globalConfig.getWebPort(), globalConfig.getWebContextName()); String webUrl = globalConfig.getWebAppUrl() + "/"; return uri.replace(WEB_APP_PREFIX, webUrl).replace(CORE_APP_PREFIX, coreUrl); }
String url = String.format("%s/open?screen=%s", globalConfig.getWebAppUrl(), frameOwner.getId());
protected String getWebAppUrl() { if (webAppUrl == null) { synchronized (this) { if (webAppUrl == null) { UserSession systemSession; try { systemSession = trustedClientService.getSystemSession(webAuthConfig.getTrustedClientPassword()); } catch (LoginException e) { throw new RuntimeException("Unable to get systemSession", e); } // webAppUrl can be overridden in DB, thus we need SecurityContext to obtain it from middleware withSecurityContext(new SecurityContext(systemSession), () -> { String webAppUrl = globalConfig.getWebAppUrl(); if (!webAppUrl.endsWith("/")) { webAppUrl += "/"; } this.webAppUrl = webAppUrl; }); } } } return this.webAppUrl; }