Package org.eclipse.jetty.server

Examples of org.eclipse.jetty.server.AbstractHttpConnection$Output


        upgradeConnection(request, response, clientToProxy);
    }

    private ClientToProxyConnection prepareConnections(ConcurrentMap<String, Object> context, SocketChannel channel, Buffer buffer)
    {
        AbstractHttpConnection httpConnection = AbstractHttpConnection.getCurrentConnection();
        ProxyToServerConnection proxyToServer = newProxyToServerConnection(context, buffer);
        ClientToProxyConnection clientToProxy = newClientToProxyConnection(context, channel, httpConnection.getEndPoint(), httpConnection.getTimeStamp());
        clientToProxy.setConnection(proxyToServer);
        proxyToServer.setConnection(clientToProxy);
        return clientToProxy;
    }
View Full Code Here


    /*
     * @see org.eclipse.jetty.server.server.Handler#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int)
     */
    public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException
    {
        AbstractHttpConnection connection = AbstractHttpConnection.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);   
        if (_cacheControl!=null)
            response.setHeader(HttpHeaders.CACHE_CONTROL, _cacheControl);
        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

     */
    @Override
    public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        // Get the real remote IP (not the one set by the forwarded headers (which may be forged))
        AbstractHttpConnection connection = baseRequest.getConnection();
        if (connection!=null)
        {
            EndPoint endp=connection.getEndPoint();
            if (endp!=null)
            {
                String addr = endp.getRemoteAddr();
                if (addr!=null && !isAddrUriAllowed(addr,baseRequest.getPathInfo()))
                {
View Full Code Here

public class FusekiErrorHandler extends ErrorHandler
{
    @Override
    public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException
    {
        AbstractHttpConnection connection = AbstractHttpConnection.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_PLAIN_UTF_8) ;
        response.setHeader(HttpHeaders.CACHE_CONTROL, "must-revalidate,no-cache,no-store") ;
       
        ByteArrayOutputStream bytes = new ByteArrayOutputStream(1024) ;
        //String writer = IO.UTF8(null) ;
        Writer writer = new OutputStreamWriter(bytes, "UTF-8") ;
       
        handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason());
       
        if ( ! Fuseki.VERSION.equalsIgnoreCase("development") )
        {
            writer.write("\n") ;
            writer.write("\n") ;
View Full Code Here

*/
public class JettyHttpServerErrorHandler extends ErrorHandler {

    @Override
    public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException {
        AbstractHttpConnection connection = AbstractHttpConnection.getCurrentConnection();
        connection.getRequest().setHandled(true);
        String method = request.getMethod();
        response.setContentType(MimeTypes.TEXT_PLAIN_8859_1);
        ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096);
        writer.write(request.getAttribute(Dispatcher.ERROR_STATUS_CODE) + " " +
                     request.getAttribute(Dispatcher.ERROR_MESSAGE) + " " +
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.server.AbstractHttpConnection$Output

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.