Example usage for org.apache.solr.response QueryResponseWriter CONTENT_TYPE_TEXT_UTF8

List of usage examples for org.apache.solr.response QueryResponseWriter CONTENT_TYPE_TEXT_UTF8

Introduction

In this page you can find the example usage for org.apache.solr.response QueryResponseWriter CONTENT_TYPE_TEXT_UTF8.

Prototype

String CONTENT_TYPE_TEXT_UTF8

To view the source code for org.apache.solr.response QueryResponseWriter CONTENT_TYPE_TEXT_UTF8.

Click Source Link

Usage

From source file:com.doculibre.constellio.wicket.servlet.SolrServletEmulator.java

License:Open Source License

final void sendErr(int rc, String msg, HttpServletResponse response, OutputStream outputStream) {
    // try {/*from w ww  . j  av  a 2  s. com*/
    // hmmm, what if this was already set to text/xml?
    try {
        response.setContentType(QueryResponseWriter.CONTENT_TYPE_TEXT_UTF8);
        // response.setCharacterEncoding("UTF-8");
    } catch (Exception e) {
    }
    try {
        response.setStatus(rc);
    } catch (Exception e) {
    }
    // PrintWriter writer = response.getWriter();
    PrintWriter writer = new PrintWriter(outputStream);
    writer.write(msg);
    // } catch (IOException e) {
    // LOGGER.log(Level.SEVERE, SolrException.toStr(e), e);
    // }
}