/** * Gets the context path from the given WebPage. * * @param page * the page * @return the context path */ public static String getContextPath(final Page page) { return page.getRequest().getContextPath(); }
public CharSequence getContextPath() { contextPath.compareAndSet(null, RequestCycle.get().getRequest().getContextPath()); return contextPath.get(); }
public CharSequence getContextPath() { contextPath.compareAndSet(null, RequestCycle.get().getRequest().getContextPath()); return contextPath.get(); }
/** * Gets the context path. * * @return the context path */ public static String getContextPath() { return RequestCycle.get().getRequest().getContextPath(); }
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; }
protected boolean isSelected(ChildEntry entry) { final String url = "/" + getRequest().getContextPath(); Reference ref = entry.getReference(); if (ref == null) { return false; } else { return isSelected(ref, url); } }
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(""); }
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(""); }
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.getContextPath()); render.append(request.getFilterPath());
protected String getBaseUrl() { return RequestCycle.get().getRequest().getContextPath() + SingularSession.get().getServerContext().getUrlPath(); }
render.append(request.getContextPath()); render.append(request.getFilterPath());
render.append(request.getContextPath()); render.append(request.getFilterPath());
render.append(request.getContextPath()); render.append(request.getFilterPath());
+ ":" + clientUrl.getPort() + r.getContextPath(); } else { styleUrl = proxyBaseUrl;