url = appendContextPath(url, httpServletRequest.getRequestURI()); + "/"; } else { url = appendContextPath(url, httpServletRequest.getRequestURI());
+ "/"; } else { url = appendContextPath(url, httpServletRequest.getContextPath());
/** * Returns the base url for a wms request, something of the form: * <pre><protocol>://<server>:<port>/<context>/wms</pre> * * @param request The request. * @param geoServer GeoServer configuration. * * @return The base for wms requests. */ public static String getBaseUrl( HttpServletRequest request, GeoServer geoServer ) { String baseUrl = Requests.getBaseUrl( request, geoServer ); baseUrl = Requests.appendContextPath(baseUrl, "wms" ); return baseUrl; }
String url = Requests.appendContextPath(baseUrl, tileCacheBaseUrl); new URL(url);