Package org.mortbay.jetty

Examples of org.mortbay.jetty.HttpConnection$OutputWriter


    /*
     * @see org.mortbay.jetty.Handler#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int)
     */
    public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException
    {
        HttpConnection connection = HttpConnection.getCurrentConnection();
        connection.getRequest().setHandled(true);
        String method = request.getMethod();
        if(!method.equals(HttpMethods.GET) && !method.equals(HttpMethods.POST) && !method.equals(HttpMethods.HEAD))
            return;
        response.setContentType(MimeTypes.TEXT_HTML_8859_1);       
        response.setHeader(HttpHeaders.CACHE_CONTROL, "must-revalidate,no-cache,no-store");
        ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096);
        handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason());
        writer.flush();
        response.setContentLength(writer.size());
        writer.writeTo(response.getOutputStream());
        writer.destroy();
    }
View Full Code Here


     * Dispatches a request.
     */
    public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        // needed to fake Jetty
        final HttpConnection2 hc = new HttpConnection2();
        HttpConnection old = hc.set(hc);
        hc.getRequest().setRequestListeners(requestListeners);

        request = new ProxiedRequest(this, request, hc);

        ClassLoader oldCCL = Thread.currentThread().getContextClassLoader();
View Full Code Here

            // some random value just to avoid NPE
            super(new LocalConnector(),null,server);
        }

        public HttpConnection set(HttpConnection v) {
            HttpConnection old = HttpConnection.getCurrentConnection();
            HttpConnection.setCurrentConnection(v);
            return old;
        }
View Full Code Here

     * Dispatches a request.
     */
    public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        // needed to fake Jetty
        final HttpConnection2 hc = new HttpConnection2();
        HttpConnection old = hc.set(hc);
        hc.getRequest().setRequestListeners(requestListeners);

        request = new ProxiedRequest(this, request, hc);

        ClassLoader oldCCL = Thread.currentThread().getContextClassLoader();
View Full Code Here

            // some random value just to avoid NPE
            super(new LocalConnector(),null,server);
        }

        public HttpConnection set(HttpConnection v) {
            HttpConnection old = HttpConnection.getCurrentConnection();
            HttpConnection.setCurrentConnection(v);
            return old;
        }
View Full Code Here

     * Dispatches a request.
     */
    public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        // needed to fake Jetty
        final HttpConnection2 hc = new HttpConnection2();
        HttpConnection old = hc.set(hc);
        hc.getRequest().setRequestListeners(requestListeners);

        request = new ProxiedRequest(this, request, hc);

        ClassLoader oldCCL = Thread.currentThread().getContextClassLoader();
View Full Code Here

            // some random value just to avoid NPE
            super(new LocalConnector(),null,server);
        }

        public HttpConnection set(HttpConnection v) {
            HttpConnection old = HttpConnection.getCurrentConnection();
            HttpConnection.setCurrentConnection(v);
            return old;
        }
View Full Code Here

        _response = null;
    }
   
    public void reset()
    {
        _connection = new HttpConnection(_connector,_endpoint,_server);
        _request = new Request(_connection);
        _response = new Response(_connection);
       
        _request.setRequestURI("/test/");
    }
View Full Code Here

    {
        // TODO: Needs an empty constructor?
        super(channel);
       
        //System.err.println("\nnew GrizzlyEndPoint channel="+channel);
        _connection = new HttpConnection(connector,this,connector.getServer());
    }
View Full Code Here

    /*
     * @see org.mortbay.jetty.Handler#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int)
     */
    public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException
    {
        HttpConnection connection = HttpConnection.getCurrentConnection();
        connection.getRequest().setHandled(true);
        String method = request.getMethod();
        if(!method.equals(HttpMethods.GET) && !method.equals(HttpMethods.POST))
            return;
        response.setContentType(MimeTypes.TEXT_HTML_8859_1);       
        response.setHeader(HttpHeaders.CACHE_CONTROL, "must-revalidate,no-cache,no-store");
        ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096);
        handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason());
        writer.flush();
        response.setContentLength(writer.size());
        writer.writeTo(response.getOutputStream());
        writer.destroy();
    }
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.HttpConnection$OutputWriter

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.