org.geoserver.ows.Request.getHttpResponse()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(215)

本文整理了Java中org.geoserver.ows.Request.getHttpResponse方法的一些代码示例,展示了Request.getHttpResponse的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getHttpResponse方法的具体详情如下:
包路径:org.geoserver.ows.Request
类名称:Request
方法名:getHttpResponse

Request.getHttpResponse介绍

[英]Returns the raw http response being handled by the Dispatcher
[中]返回由调度器处理的原始http响应

代码示例

代码示例来源:origin: geoserver/geoserver

@Override
public void handleServiceException(ServiceException exception, Request request) {
  HttpServletResponse response = request.getHttpResponse();
  response.setContentType(Dispatcher.SOAP_MIME);

代码示例来源:origin: geoserver/geoserver

contentDispositionProvided = true;
    if (disposition == null) {
      req.getHttpResponse().addHeader(headers[i][0], headers[i][1]);
    req.getHttpResponse().addHeader(headers[i][0], headers[i][1]);
req.getHttpResponse().setHeader("Content-Disposition", disp);

代码示例来源:origin: geoserver/geoserver

HttpServletResponse httpResponse = request.getHttpResponse();
if (httpResponse.containsHeader(HttpHeaders.CONTENT_DISPOSITION)) {
  try {

代码示例来源:origin: geoserver/geoserver

ServiceStrategy outputStrategy = findOutputStrategy(req.getHttpResponse());
  req.getHttpResponse().setContentType(SOAP_MIME);
} else {
  req.getHttpResponse().setContentType(mimeType);
  req.getHttpResponse().setCharacterEncoding(charset);
OutputStream output = outputStrategy.getDestination(req.getHttpResponse());
boolean abortResponse = true;
try {
    outputStrategy.flush(req.getHttpResponse());
  } catch (IOException e) {
    throw new ClientStreamAbortedException(e);
req.getHttpResponse().getOutputStream().flush();

代码示例来源:origin: geoserver/geoserver

request.getHttpResponse().setContentType("application/xml");
      report,
      org.geoserver.ows.xml.v1_0.OWS.EXCEPTIONREPORT,
      request.getHttpResponse().getOutputStream());
} catch (Exception ex) {
} finally {
  try {
    request.getHttpResponse().getOutputStream().flush();
  } catch (IOException ioe) {

代码示例来源:origin: geoserver/geoserver

HttpServletResponse rsp = request.getHttpResponse();

代码示例来源:origin: geoserver/geoserver

Ows11Util.exceptionReport(exception, verboseExceptions, version);
HttpServletResponse response = request.getHttpResponse();
if (!request.isSOAP()) {

代码示例来源:origin: geoserver/geoserver

parameters[i] = req.getHttpRequest();
} else if (parameterType.isAssignableFrom(HttpServletResponse.class)) {
  parameters[i] = req.getHttpResponse();
  parameters[i] = req.getHttpRequest().getInputStream();
} else if (parameterType.isAssignableFrom(OutputStream.class)) {
  parameters[i] = req.getHttpResponse().getOutputStream();
} else {

代码示例来源:origin: org.geoserver/gs-wms

@Override
public Response responseDispatched(
    Request request, Operation operation, Object result, Response response) {
  List<String> warnings = WARNINGS.get();
  if ("WMS".equalsIgnoreCase(request.getService())
      && warnings != null
      && !warnings.isEmpty()) {
    HttpServletResponse httpResponse = request.getHttpResponse();
    for (String warning : warnings) {
      httpResponse.addHeader(HttpHeaders.WARNING, warning);
    }
    return super.responseDispatched(request, operation, result, response);
  }
  return response;
}

代码示例来源:origin: org.geoserver/gs-wms

private void handlePartialMapException(
    ServiceException exception, Request request, String format) {
  RenderedImageMap map = (RenderedImageMap) ((WMSPartialMapException) exception).getMap();
  try {
    final HttpServletResponse response = request.getHttpResponse();
    if ("image/png8".equals(format)) {
      response.setContentType("image/png");
    } else {
      response.setContentType(format);
    }
    final ServletOutputStream os = response.getOutputStream();
    ImageIO.write(map.getImage(), IMAGEIO_FORMATS.get(format), os);
    os.flush();
  } catch (IOException e) {
    LOGGER.log(
        Level.INFO, "Problem writing exception information back to calling client:", e);
  }
}

代码示例来源:origin: org.geoserver/gs-wfs

private void setHttpHeaders(ServiceException exception, Request request) {
    HttpServletResponse response = request.getHttpResponse();
    String code = exception.getCode();

    if (code == null) {
      exception.setCode(WFSException.NO_APPLICABLE_CODE);
    }

    if (WFSException.OPERATION_PROCESSING_FAILED.equals(code)) {
      response.setStatus(500);
    } else if (WFSException.NOT_FOUND.equals(code)) {
      response.setStatus(404);
    } else if (WFSException.LOCK_HAS_EXPIRED.equals(code)) {
      response.setStatus(403);
    } else {
      // all other codes use 400
      response.setStatus(400);
    }
  }
}

代码示例来源:origin: org.geoserver/gs-wfs

private void handleDefault(
    ServiceException exception, Request request, String charset, boolean verbose) {
  if ("1.0.0".equals(request.getVersion())) {
    handle1_0(exception, request.getHttpResponse());
  } else {
    super.handleServiceException(exception, request);
  }
}

代码示例来源:origin: org.geoserver.community/gs-oseo-core

@Override
public void handleServiceException(ServiceException exception, Request request) {
  HttpServletResponse response = request.getHttpResponse();
  response.setContentType("application/xml");
  } finally {
    try {
      request.getHttpResponse().getOutputStream().flush();
    } catch (IOException ioe) {

代码示例来源:origin: org.geoserver/gs-wfs

boolean isJsonp) {
final HttpServletResponse response = request.getHttpResponse();

代码示例来源:origin: org.geoserver.community/gs-wfs3

@Override
public void handleServiceException(ServiceException exception, Request request) {
  HttpServletResponse response = request.getHttpResponse();
  response.setContentType(BaseRequest.JSON_MIME);
  } finally {
    try {
      request.getHttpResponse().getOutputStream().flush();
    } catch (IOException ignored) {

代码示例来源:origin: org.geoserver/wms

final HttpServletResponse response = request.getHttpResponse();
response.setContentType(format);
final ServletOutputStream os = response.getOutputStream();

代码示例来源:origin: org.geoserver.community/gs-nsg-wfs-profile

@Override
public Operation operationDispatched(Request request, Operation operation) {
  String version = request.getVersion();
  String method = request.getRequest();
  long timeout = getTimeoutMilliseconds(operation);
  if ("WFS".equalsIgnoreCase(request.getService())
      && (version == null || V_20.compareTo(new Version(version)) <= 0)
      && method != null
      && (method.equalsIgnoreCase("GetFeature")
          || method.equalsIgnoreCase("GetFeatureWithLock")
          || method.equalsIgnoreCase("GetPropertyValue"))
      && timeout > 0
      && operation.getParameters().length > 0
      && operation.getParameters()[0] instanceof BaseRequestType) {
    if (LOGGER.isLoggable(Level.FINE)) {
      LOGGER.fine("Starting to track NSG timeout on this request");
    }
    // start tracking time
    TimeoutVerifier timeoutVerifier =
        new TimeoutVerifier((BaseRequestType) operation.getParameters()[0], timeout);
    // need to wrap the http response and its output stream
    request.setHttpResponse(
        new TimeoutCancellingResponse(request.getHttpResponse(), timeoutVerifier));
    // set in the thread local for later use
    TIMEOUT_VERIFIER.set(timeoutVerifier);
  }
  return operation;
}

代码示例来源:origin: org.geoserver/wcs1_1

report.getException().add(e);
HttpServletResponse response = request.getHttpResponse();
response.setContentType("application/xml");

代码示例来源:origin: org.geoserver.community/gs-wfs3

@Override
public Response responseDispatched(
    Request request, Operation operation, Object result, Response response) {
  // is this a feature response we are about to encode?
  if (result instanceof FeatureCollectionResponse) {
    HttpServletResponse httpResponse = request.getHttpResponse();
    FeatureCollectionResponse fcr = (FeatureCollectionResponse) result;
    String contentType = response.getMimeType(result, operation);
    if (fcr.getPrevious() != null) {
      addLink(httpResponse, "prev", contentType, fcr.getPrevious());
    }
    if (fcr.getNext() != null) {
      addLink(httpResponse, "next", contentType, fcr.getNext());
    }
  }
  return response;
}

代码示例来源:origin: org.geoserver.extension/control-flow

waitTerminated(tSample, MAX_WAIT);
Cookie cookie = (Cookie) ((MockHttpServletResponse) firstRequest.getHttpResponse()).getCookies().get(0);
String cookieValue = cookie.getValue();

相关文章