/** * @param relativePagePath * @return * @see RequestUtils#toAbsolutePath(String, String) * @see URLHelper#removeJSessionId(String) */ public final static String toAbsolutePath(final String requestUrl, final String relativePagePath) { final String absoluteUrl = RequestUtils.toAbsolutePath(requestUrl, relativePagePath); return URLHelper.removeJSessionId(absoluteUrl); }
/** * replacement for {@link RequestUtils}.toAbsolutePath(String) * * Calculates absolute path to url relative to another absolute url. * * @param relativePagePath * path, relative to requestPath * @return absolute path for given url */ public final static String toAbsolutePath(final String relativePagePath) { return RequestUtils.toAbsolutePath(getHttpServletRequest().getRequestURL().toString(), relativePagePath); }
public static String toAbsolutePath(final String relativePagePath) { HttpServletRequest req = getHttpServletRequest(); return RequestUtils.toAbsolutePath(req.getRequestURL().toString(), relativePagePath); }
public static CharSequence toAbsoluteUrl(String url) { // make relative links absolute if (url.startsWith("../../")) { HttpServletRequest req = ((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest(); return req.getContextPath() + "/" + url.substring("../../".length()); } else { return RequestUtils.toAbsolutePath(url); } }
public static CharSequence toAbsoluteUrl(String url) { // make relative links absolute if (url.startsWith("../../")) { HttpServletRequest req = ((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest(); return req.getContextPath() + "/" + url.substring("../../".length()); } else { return RequestUtils.toAbsolutePath(url); } }
/** * Helper method for the migration from wicket-version 1.5.x to 6.x. * * @param relativePagePath * the relative page path * @return the string */ public static String toAbsolutePath(final String relativePagePath) { final HttpServletRequest req = (HttpServletRequest)((WebRequest)RequestCycle.get() .getRequest()).getContainerRequest(); return RequestUtils.toAbsolutePath(req.getRequestURL().toString(), relativePagePath); }
public YuiLoaderModule(String name, ModuleType type, ResourceReference ref, String[] requires) { this(name, type, RequestUtils.toAbsolutePath((String)RequestCycle.get().urlFor(ref)), requires); }
/** * Calculates absolute path to url relative to another absolute url. * * @param relativePagePath * path, relative to requestPath * @return absolute path for given url */ public final static String toAbsolutePath(final String relativePagePath) { HttpServletRequest req = ((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest(); return toAbsolutePath(req.getRequestURL().toString(), relativePagePath); }
/** * Calculates absolute path to url relative to another absolute url. * * @param relativePagePath * path, relative to requestPath * @return absolute path for given url */ public final static String toAbsolutePath(final String relativePagePath) { HttpServletRequest req = ((WebRequest)RequestCycle.get().getRequest()) .getHttpServletRequest(); return toAbsolutePath(req.getRequestURL().toString(), relativePagePath); }
/** * Get the absolute bookmarkable path of a page * * @param pageClass Page * @param pageParameters Optional page parameters * @return Bookmarkable path */ public static String absoluteMountPathForPage(Class<? extends Page> pageClass, PageParameters pageParameters) { HttpServletRequest req = getHttpServletRequest(); RequestCycle requestCycle = RequestCycle.get(); Url url = requestCycle.mapUrlFor(pageClass, pageParameters); String renderedUrl = url.toString(); renderedUrl = Strings.isEmpty(renderedUrl) ? "." : renderedUrl; return RequestUtils.toAbsolutePath(HttpUtils.getWebappContextUrl(req), requestCycle.getOriginalResponse().encodeURL(renderedUrl)); }