/** * Returns the HTTP URL for accessing the {@link ResourcesServlet}. * <p> * NOTE: This method will only return a correct result if the calling thread originated in the * {@link #doGet(HttpServletRequest, HttpServletResponse)} or * {@link #doPost(HttpServletRequest, HttpServletResponse)} of this class (or has been spawned as a child thread by * such a thread). * </p> * * @return URL, never <code>null</code> (without trailing slash or question mark) */ public static String getResourcesUrl() { return getContext().getResourcesUrl(); }
public String getRestURL() { return OGCFrontController.getContext().getResourcesUrl() + "../rest" + UriBuilder.fromResource( WSDLResource.class ).path( WSDLResource.class, "get" ).build( "ALL" ).toString(); } }
private static String getHttpURL() { RequestContext context = getContext(); String xForwardedHost = context.getXForwardedHost(); if ( xForwardedHost != null && xForwardedHost != "" ) { String contextServiceUrl = context.getServiceUrl(); try { URL serviceUrl = new URL( contextServiceUrl ); return buildUrlFromForwardedHeader( context, serviceUrl ); } catch ( MalformedURLException e ) { LOG.warn( "Could not parse service URL as URL: " + contextServiceUrl ); } } return context.getServiceUrl(); }
throws ServletException { String userAgent = null; if ( OGCFrontController.getContext() != null ) { userAgent = OGCFrontController.getContext().getUserAgent();
@Override protected void exportCapas( String getUrl, String postUrl, MapService service, HttpResponseBuffer response, ServiceIdentification identification, ServiceProvider provider, Map<String, String> customParameters, WMSController controller, OWSMetadataProvider metadata ) throws IOException, OWSException { response.setContentType( "application/vnd.ogc.wms_xml" ); String userAgent = OGCFrontController.getContext().getUserAgent(); if ( userAgent != null && userAgent.toLowerCase().contains( "mozilla" ) ) { response.setContentType( "application/xml" ); } response.addHeader( "Content-Disposition", "inline; filename=\"capabilities.xml\"" ); try { XMLStreamWriter xmlWriter = response.getXMLWriter(); new Capabilities111XMLAdapter( identification, provider, metadata, getUrl, postUrl, service, controller ).export( xmlWriter ); } catch ( XMLStreamException e ) { throw new IOException( e ); } }
throws ServletException { String userAgent = null; if ( OGCFrontController.getContext() != null ) { userAgent = OGCFrontController.getContext().getUserAgent();