org.mortbay.jetty.HttpConnection.getResponse()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(96)

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

HttpConnection.getResponse介绍

暂无

代码示例

代码示例来源:origin: org.restlet/org.restlet.ext.jetty

/**
 * Returns the response stream if it exists.
 * 
 * @return The response stream if it exists.
 */
@Override
public OutputStream getResponseEntityStream() {
  try {
    return getConnection().getResponse().getOutputStream();
  } catch (IOException e) {
    getLogger().log(Level.WARNING,
        "Unable to get response entity stream", e);
    return null;
  }
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

public void handle(HttpConnection connection) throws IOException, ServletException
{
  String target=connection.getRequest().getPathInfo();
  if (Log.isDebugEnabled())
  {
    Log.debug("REQUEST "+target+" on "+connection);
    handle(target, connection.getRequest(), connection.getResponse(), Handler.REQUEST);
    Log.debug("RESPONSE "+target+"  "+connection.getResponse().getStatus());
  }
  else
    handle(target, connection.getRequest(), connection.getResponse(), Handler.REQUEST);
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException
{
  HttpConnection.getCurrentConnection().getRequest().setHandled(true);
  response.setContentType(MimeTypes.TEXT_HTML_8859_1);
  ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096);
  HttpConnection connection = HttpConnection.getCurrentConnection();
  handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason());
  writer.flush();
  response.setContentLength(writer.size());
  writer.writeTo(response.getOutputStream());
  writer.destroy();
}

代码示例来源:origin: org.restlet/org.restlet.ext.jetty

@Override
  public void sendResponse(Response response) throws IOException {
    // Add call headers
    Parameter header;
    for (final Iterator<Parameter> iter = getResponseHeaders().iterator(); iter
        .hasNext();) {
      header = iter.next();
      getConnection().getResponse().addHeader(header.getName(),
          header.getValue());
    }

    // Set the status code in the response. We do this after adding the
    // headers because when we have to rely on the 'sendError' method,
    // the Servlet containers are expected to commit their response.
    if (Status.isError(getStatusCode()) && (response.getEntity() == null)) {
      try {
        getConnection().getResponse().sendError(getStatusCode(),
            getReasonPhrase());
      } catch (IOException ioe) {
        getLogger().log(Level.WARNING,
            "Unable to set the response error status", ioe);
      }
    } else {
      // Send the response entity
      getConnection().getResponse().setStatus(getStatusCode());
      super.sendResponse(response);
    }

  }
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException
  final Response base_response=(response instanceof Response)?((Response)response):HttpConnection.getCurrentConnection().getResponse();

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

public HttpSession getSession(boolean create)
{
  if (_sessionManager==null && create)
    throw new IllegalStateException("No SessionHandler or SessionManager");
  
  if (_session != null && _sessionManager!=null && _sessionManager.isValid(_session))
    return _session;
  
  _session=null;
  
  String id=getRequestedSessionId();
  
  if (id != null && _sessionManager!=null)
  {
    _session=_sessionManager.getHttpSession(id);
    if (_session == null && !create)
      return null;
  }
  
  if (_session == null && _sessionManager!=null && create )
  {
    _session=_sessionManager.newHttpSession(this);
    Cookie cookie=_sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
    if (cookie!=null)
      _connection.getResponse().addCookie(cookie);
  }
  
  return _session;
}

代码示例来源:origin: stevensouza/jamonapi

/** Monitor the request and call any other requests in the decorator chain */
@Override
public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException  {
  final Request baseRequest = (request instanceof Request) ? ((Request)request) : HttpConnection.getCurrentConnection().getRequest();
  final Response baseResponse = (response instanceof Response) ? ((Response)response) : HttpConnection.getCurrentConnection().getResponse();
  HttpMon httpMon=null;
  try {
    httpMon=httpMonFactory.start(baseRequest, baseResponse);
    super.handle(target, request, response, dispatch);
  } catch (Throwable e) {
    httpMon.throwException(e);
  } finally {
    httpMon.stop();
  }
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

Response base_response=(response instanceof Response)?(Response)response:HttpConnection.getCurrentConnection().getResponse();

代码示例来源:origin: org.mortbay.jetty/jetty-security

Response base_response=(response instanceof Response)?(Response)response:HttpConnection.getCurrentConnection().getResponse();

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

if (base_request.getConnection().getResponse().isWriting())

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException 
  Response base_response = (response instanceof Response) ? (Response)response:HttpConnection.getCurrentConnection().getResponse();
  UserRealm old_realm = base_request.getUserRealm();
  try

代码示例来源:origin: org.mortbay.jetty/jetty-security

public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException 
  Response base_response = (response instanceof Response) ? (Response)response:HttpConnection.getCurrentConnection().getResponse();
  UserRealm old_realm = base_request.getUserRealm();
  try

相关文章