org.apache.catalina.connector.Response.getWriter()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(403)

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

Response.getWriter介绍

[英]Return the writer associated with this Response.
[中]返回与此响应关联的编写器。

代码示例

代码示例来源:origin: org.glassfish.main.web/web-core

@Override
public PrintWriter getWriter() throws IOException {
  // Disallow operation if the object has gone out of scope
  if (response == null) {
    throw new IllegalStateException(rb.getString(LogFacade.NULL_RESPONSE_OBJECT));
  }
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished())
    response.setSuspended(true);
  return (writer);
}

代码示例来源:origin: jboss.web/jbossweb

public PrintWriter getWriter()
  throws IOException {
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished())
    response.setSuspended(true);
  return (writer);
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

@Override
public PrintWriter getWriter()
  throws IOException {
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished()) {
    response.setSuspended(true);
  }
  return writer;
}

代码示例来源:origin: tomcat/catalina

public PrintWriter getWriter()
  throws IOException {
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished())
    response.setSuspended(true);
  return (writer);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public PrintWriter getWriter()
  throws IOException {
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished())
    response.setSuspended(true);
  return (writer);
}

代码示例来源:origin: org.jboss.web/jbossweb

public PrintWriter getWriter()
  throws IOException {
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished())
    response.setSuspended(true);
  return (writer);
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

@Override
public PrintWriter getWriter()
  throws IOException {
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished()) {
    response.setSuspended(true);
  }
  return (writer);
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

@Override
public PrintWriter getWriter()
  throws IOException {
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished()) {
    response.setSuspended(true);
  }
  return (writer);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

@Override
public PrintWriter getWriter()
  throws IOException {
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished())
    response.setSuspended(true);
  return (writer);
}

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public PrintWriter getWriter()
  throws IOException {
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished()) {
    response.setSuspended(true);
  }
  return (writer);
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
public PrintWriter getWriter()
  throws IOException {
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished()) {
    response.setSuspended(true);
  }
  return writer;
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public PrintWriter getWriter()
  throws IOException {
  //        if (isFinished())
  //            throw new IllegalStateException
  //                (/*sm.getString("responseFacade.finished")*/);
  PrintWriter writer = response.getWriter();
  if (isFinished())
    response.setSuspended(true);
  return (writer);
}

代码示例来源:origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.interceptor

/**
 * Send an Error Response in application/xml content type
 * 
 * @param response
 * @param payload
 */
public static void handleRestFailure(Response response, String payload) {
  response.setStatus(403);
  response.setContentType("application/xml");
  response.setCharacterEncoding("UTF-8");
  try {
    response.getWriter().write(payload);
  } catch (IOException e) {
    log.error("Error in sending fault response", e);
  }
}

代码示例来源:origin: apache/meecrowave

@Override
public void invoke(final Request request, final Response response) throws IOException, ServletException {
  if (request.getRequestURI().equals(current.endpoint)) {
    response.setHeader("Content-Type", "text/plain");
    response.getWriter().write(current.challenge);
    return;
  }
  getNext().invoke(request, response);
}

代码示例来源:origin: org.nuxeo.lib.runtime/nuxeo-runtime-tomcat-adapter

private void getFile(String path, Request req, Response resp) {
  File file = getSDKFile(path);
  if (file == null) {
    resp.setStatus(404);
  } else {
    resp.setContentType("text/plain");
    resp.setCharacterEncoding("UTF-8");
    resp.setStatus(200);
    try {
      Writer out = resp.getWriter();
      sendFile(file, out);
      out.flush();
    } catch (IOException e) {
      resp.setStatus(500);
      log.error("Failed to send file: " + file, e);
    }
  }
}

代码示例来源:origin: org.wso2.carbon.identity.auth.rest/org.wso2.carbon.identity.context.rewrite.valve

private void handleInvalidTenantDomainErrorResponse(Response response, int error, String tenantDomain) throws
      IOException, ServletException {

    response.setContentType("application/json");
    response.setStatus(error);
    response.setCharacterEncoding("UTF-8");
    JsonObject errorResponse = new JsonObject();
    String errorMsg = "invalid tenant domain : " + tenantDomain;
    errorResponse.add("code", error);
    errorResponse.add("message", errorMsg);
    errorResponse.add("description", errorMsg);
    response.getWriter().print(errorResponse.toString());
  }
}

代码示例来源:origin: org.apache.cxf.fediz/fediz-tomcat

PrintWriter out = response.getWriter();

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

setHeader("Location", absolute);
if (getContext().getSendRedirectBody()) {
  PrintWriter writer = getWriter();
  writer.print(sm.getString("coyoteResponse.sendRedirect.note",
      RequestUtil.filter(absolute)));

代码示例来源:origin: codefollower/Tomcat-Research

setHeader("Location", absolute);
if (getContext().getSendRedirectBody()) {
  PrintWriter writer = getWriter();
  writer.print(sm.getString("coyoteResponse.sendRedirect.note",
      RequestUtil.filter(absolute)));

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

setHeader("Location", locationUri);
if (getContext().getSendRedirectBody()) {
  PrintWriter writer = getWriter();
  writer.print(sm.getString("coyoteResponse.sendRedirect.note",
      Escape.htmlElementContent(locationUri)));

相关文章

Response类方法