Package org.openqa.jetty.util

Examples of org.openqa.jetty.util.ByteArrayISO8859Writer


                                int postReserve)
    {
        super(capacity,headerReserve,postReserve);
        _out=out;
        _preReserve=preReserve;
        _httpMessageWriter = new ByteArrayISO8859Writer(headerReserve);
    }
View Full Code Here


        response.setStatus(404);
        request.setHandled(true);
        response.setReason("Not Found");
        response.setContentType(HttpFields.__TextHtml);
       
        ByteArrayISO8859Writer writer = new ByteArrayISO8859Writer(1500);

        String uri=request.getPath();
        uri=StringUtil.replace(uri,"<","&lt;");
        uri=StringUtil.replace(uri,">","&gt;");
       
        writer.write("<HTML>\n<HEAD>\n<TITLE>Error 404 - Not Found");
        writer.write("</TITLE>\n<BODY>\n<H2>Error 404 - Not Found.</H2>\n");
        writer.write("No context on this server matched or handled this request.<BR>");
        writer.write("Contexts known to this server are: <ul>");

        HttpContext[] contexts = getHttpContext().getHttpServer().getContexts();
       
        for (int i=0;i<contexts.length;i++)
        {
            HttpContext context = contexts[i];
            writer.write("<li><a href=\"");
            writer.write(context.getContextPath());
            writer.write("/\">");
            writer.write(context.toString());
            writer.write("</a></li>\n");
        }
       
        writer.write("</ul><small><I>The links above may not work if a virtual host is configured</I></small>");

  for (int i=0;i<10;i++)
      writer.write("\n<!-- Padding for IE                  -->");
 
        writer.write("\n</BODY>\n</HTML>\n");
        writer.flush();
        response.setContentLength(writer.size());
        OutputStream out=response.getOutputStream();
        writer.writeTo(out);
        out.close();
    }
View Full Code Here

        response.setField(HttpFields.__ContentType,
                          HttpFields.__MessageHttp);
        if (trace)
        {
            OutputStream out = response.getOutputStream();
            ByteArrayISO8859Writer writer = new ByteArrayISO8859Writer();
            writer.write(request.toString());
            writer.flush();
            response.setIntField(HttpFields.__ContentLength,writer.size());
            writer.writeTo(out);
            out.flush();
        }
        request.setHandled(true);
    }
View Full Code Here

            addInt(0xFFFF);
            return;
        }

        if (_byteWriter==null)
            _byteWriter=new ByteArrayISO8859Writer(_buf);

        int p=_bytes+2;
        _byteWriter.setLength(p);
        _byteWriter.write(s);
        int l=_byteWriter.size()-p;
View Full Code Here

        HttpRequest request,
        HttpResponse response)
        throws HttpException, IOException
    {
        response.setContentType(HttpFields.__TextHtml);
        ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(2048);
        writeErrorPage(request, writer, response.getStatus(), response.getReason());
        writer.flush();
        response.setContentLength(writer.size());
        writer.writeTo(response.getOutputStream());
        writer.destroy();
    }
View Full Code Here

        throws IOException
    {
        response.setHeader(HttpFields.__ContentType,
                           HttpFields.__MessageHttp);
        OutputStream out = response.getOutputStream();
        ByteArrayISO8859Writer writer = new ByteArrayISO8859Writer();
        writer.write(request.toString());
        writer.flush();
        response.setIntHeader(HttpFields.__ContentLength,writer.size());
        writer.writeTo(out);
        out.flush();
    }
View Full Code Here

        response.setField(HttpFields.__ContentType,
                          HttpFields.__MessageHttp);
        if (trace)
        {
            OutputStream out = response.getOutputStream();
            ByteArrayISO8859Writer writer = new ByteArrayISO8859Writer();
            writer.write(request.toString());
            writer.flush();
            response.setIntField(HttpFields.__ContentLength,writer.size());
            writer.writeTo(out);
            out.flush();
        }
        request.setHandled(true);
    }
View Full Code Here

    /** Start a log sink.
     * The default implementation does nothing
     */
    public synchronized void start()
    {
        _buffer=new ByteArrayISO8859Writer(_bufferSize);
        _reopen=false;
        if (_started)
            return;
       
        if (_out==null && _filename!=null)
View Full Code Here

TOP

Related Classes of org.openqa.jetty.util.ByteArrayISO8859Writer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.