public CharSequence getFilterPrefix() { if (filterPrefix.get() == null) { if (USING_JAVAX_WEB_SOCKET) { filterPrefix.compareAndSet(null, ""); } else { filterPrefix.compareAndSet(null, RequestCycle.get().getRequest().getFilterPath()); } } return filterPrefix.get(); }
public CharSequence getFilterPrefix() { if (filterPrefix.get() == null) { if (USING_JAVAX_WEB_SOCKET) { filterPrefix.compareAndSet(null, ""); } else { filterPrefix.compareAndSet(null, RequestCycle.get().getRequest().getFilterPath()); } } return filterPrefix.get(); }
/** * * @return the web context or "" if mounted as / */ public static String getContextPath() { String path = RequestCycle.get().getRequest().getFilterPath(); if(path==null || path.isEmpty()) return ""; return path; }
private Url encodeSharedResourceUrl(Url url) { if (url != null) { Request request = RequestCycle.get().getRequest(); StringBuilder urlBuilder = new StringBuilder(); urlBuilder.append(request.getContextPath()); urlBuilder.append(request.getFilterPath()); urlBuilder.append(PortletFilter.SHARED_RESOURCE_URL_PORTLET_WINDOW_ID_PREFIX); urlBuilder.append(Base64.encodeBase64URLSafeString(ThreadPortletContext.getWindowID().getBytes())); urlBuilder.append('/'); urlBuilder.append(url.toString()); url = Url.parse(urlBuilder.toString()); } return url; }
private String mountLogoutPathWithRequectCycle(RequestCycle requestCycle, String baseUrl) { Request request = requestCycle.getRequest(); Url url = request.getUrl(); UrlToolkit urlToolkit = urlToolkitBuilder.build(url); Optional<String> filterPath = Optional.ofNullable(request.getFilterPath()); String logoutPath = urlToolkit.concatServerAdressWithContext(baseUrl); logoutPath += "?service=" + urlToolkit.concatServerAdressWithContext(contextPath + filterPath.orElse("")); return logoutPath; }
public static String getBaseURL() { final RequestCycle requestCycle = RequestCycle.get(); final Request request = requestCycle.getRequest(); final String currentPath = request.getUrl().toString(); String fullUrl = requestCycle.getUrlRenderer().renderFullUrl(request.getUrl()); if (org.apache.commons.lang3.StringUtils.isNotBlank(currentPath)) { final int beginPath = fullUrl.lastIndexOf(currentPath); fullUrl = fullUrl.substring(0, beginPath - 1); } final Optional<String> contextPath = Optional.ofNullable(requestCycle.getRequest().getContextPath()); final Optional<String> filterPath = Optional.ofNullable(requestCycle.getRequest().getFilterPath()); return fullUrl + contextPath.orElse("") + filterPath.orElse(""); }
public static String getBaseURL() { final RequestCycle requestCycle = RequestCycle.get(); final Request request = requestCycle.getRequest(); final String currentPath = request.getUrl().toString(); String fullUrl = requestCycle.getUrlRenderer().renderFullUrl(request.getUrl()); if (org.apache.commons.lang3.StringUtils.isNotBlank(currentPath)) { final int beginPath = fullUrl.lastIndexOf(currentPath); fullUrl = fullUrl.substring(0, beginPath - 1); } final Optional<String> contextPath = Optional.ofNullable(requestCycle.getRequest().getContextPath()); final Optional<String> filterPath = Optional.ofNullable(requestCycle.getRequest().getFilterPath()); return fullUrl + contextPath.orElse("") + filterPath.orElse(""); }
private String mountLogoutPathWithRequectCycle(RequestCycle requestCycle, String baseUrl) { Request request = requestCycle.getRequest(); Url url = request.getUrl(); UrlToolkit urlToolkit = urlToolkitBuilder.build(url); Optional<String> filterPath = Optional.ofNullable(request.getFilterPath()); String logoutPath = urlToolkit.concatServerAdressWithContext(baseUrl); logoutPath += "?service=" + urlToolkit.concatServerAdressWithContext(contextPath + filterPath.orElse("")); return logoutPath; }
private String mountLogoutPathWithRequectCycle(RequestCycle requestCycle, String baseUrl) { Request request = requestCycle.getRequest(); Url url = request.getUrl(); UrlToolkit urlToolkit = urlToolkitBuilder.build(url); Optional<String> filterPath = Optional.ofNullable(request.getFilterPath()); String logoutPath = urlToolkit.concatServerAdressWithContext(baseUrl); logoutPath += "?service=" + urlToolkit.concatServerAdressWithContext(contextPath + filterPath.orElse("")); return logoutPath; }
public static String getBaseURL() { final RequestCycle requestCycle = RequestCycle.get(); final Request request = requestCycle.getRequest(); final String currentPath = request.getUrl().toString(); String fullUrl = requestCycle.getUrlRenderer().renderFullUrl(request.getUrl()); if (org.apache.commons.lang3.StringUtils.isNotBlank(currentPath)) { final int beginPath = fullUrl.lastIndexOf(currentPath); fullUrl = fullUrl.substring(0, beginPath - 1); } final Optional<String> contextPath = Optional.ofNullable(requestCycle.getRequest().getContextPath()); final Optional<String> filterPath = Optional.ofNullable(requestCycle.getRequest().getFilterPath()); return fullUrl + contextPath.orElse("") + filterPath.orElse(""); }
public static String getWicketAppPath() { Request request = RequestCycle.get().getRequest(); return request.getContextPath() + request.getFilterPath() + "/"; }
public static String getBaseURL() { final RequestCycle requestCycle = RequestCycle.get(); final Request request = requestCycle.getRequest(); final String currentPath = request.getUrl().toString(); String fullUrl = requestCycle.getUrlRenderer().renderFullUrl(request.getUrl()); if (org.apache.commons.lang3.StringUtils.isNotBlank(currentPath)) { final int beginPath = fullUrl.lastIndexOf(currentPath); fullUrl = fullUrl.substring(0, beginPath - 1); } final Optional<String> contextPath = Optional.ofNullable(requestCycle.getRequest().getContextPath()); final Optional<String> filterPath = Optional.ofNullable(requestCycle.getRequest().getFilterPath()); return fullUrl + contextPath.orElse("") + filterPath.orElse(""); } }
Url commonPrefix = Url.parse(request.getContextPath() + request.getFilterPath());
Url commonPrefix = Url.parse(request.getContextPath() + request.getFilterPath());
render.append(request.getFilterPath());
render.append(request.getFilterPath());
render.append(request.getFilterPath());
render.append(request.getFilterPath());