/** * Rewrites a relative url to be context relative, leaves absolute urls same. * * @param url * @param requestCycle * @return rewritten url */ public static String rewriteToContextRelative(String url, IRequestCycle requestCycle) { if (isRelative(url)) { return requestCycle.getUrlRenderer().renderContextRelativeUrl(url); } else { return url; } }
/** * Rewrites a relative url to be context relative, leaves absolute urls same. * * @param url * @param requestCycle * @return rewritten url */ public static String rewriteToContextRelative(String url, IRequestCycle requestCycle) { if (isRelative(url)) { return requestCycle.getUrlRenderer().renderContextRelativeUrl(url); } else { return url; } }
/** * Imports the contents of the url of the model object. * * @return the imported contents */ protected String importAsString() { // gets the model object: should provide us with either an absolute or a // relative url String url = getModelObject(); if (UrlUtils.isRelative(url)) { return importRelativeUrl(url); } else { return importAbsoluteUrl(url); } }
/** * Imports the contents of the url of the model object. * * @return the imported contents */ protected String importAsString() { // gets the model object: should provide us with either an absolute or a // relative url String url = getModelObject(); if (UrlUtils.isRelative(url)) { return importRelativeUrl(url); } else { return importAbsoluteUrl(url); } }