Package org.mortbay.jetty

Examples of org.mortbay.jetty.HttpFields$Field


        SslSocketConnector sslConnector = new SslSocketConnector(){
            //backport from jetty 8's url scheme forwarding support
            @Override
            protected void checkForwardedHeaders(EndPoint endpoint, Request request) throws IOException {
                super.checkForwardedHeaders(endpoint, request);
                HttpFields httpFields = request.getConnection().getRequestFields();
                String forwardedProto = getLeftMostValue(httpFields.getStringField("X-Forwarded-Proto"));
                if (forwardedProto != null)
                {
                    request.setScheme(forwardedProto);
                }
            }
View Full Code Here


                EasyMock.expect(request.getQueryString()).andReturn(query);           
                EasyMock.expect(request.getHeader("Accept")).andReturn("*/*")
                EasyMock.expect(request.getContentType()).andReturn("text/xml charset=utf8");
                EasyMock.expect(request.getAttribute("org.mortbay.jetty.ajax.Continuation")).andReturn(null);
               
                HttpFields httpFields = new HttpFields();
                httpFields.add("content-type", "text/xml");
                httpFields.add("content-type", "charset=utf8");
                httpFields.put(JettyHTTPDestinationTest.AUTH_HEADER, JettyHTTPDestinationTest.BASIC_AUTH);
               
                EasyMock.expect(request.getHeaderNames()).andReturn(httpFields.getFieldNames());
                request.getHeaders("content-type");
                EasyMock.expectLastCall().andReturn(httpFields.getValues("content-type"));
                request.getHeaders(JettyHTTPDestinationTest.AUTH_HEADER);
                EasyMock.expectLastCall().andReturn(
                    httpFields.getValues(JettyHTTPDestinationTest.AUTH_HEADER));
                
                EasyMock.expect(request.getInputStream()).andReturn(is);
                request.setHandled(true);
                EasyMock.expectLastCall()
                response.flushBuffer();
View Full Code Here

                EasyMock.expect(request.getQueryString()).andReturn(query);   
                EasyMock.expect(request.getHeader("Accept")).andReturn("*/*")
                EasyMock.expect(request.getContentType()).andReturn("text/xml charset=utf8");
                EasyMock.expect(request.getAttribute("org.mortbay.jetty.ajax.Continuation")).andReturn(null);
               
                HttpFields httpFields = new HttpFields();
                httpFields.add("content-type", "text/xml");
                httpFields.add("content-type", "charset=utf8");
                httpFields.put(JettyHTTPDestinationTest.AUTH_HEADER, JettyHTTPDestinationTest.BASIC_AUTH);
               
                EasyMock.expect(request.getHeaderNames()).andReturn(httpFields.getFieldNames());
                request.getHeaders("content-type");
                EasyMock.expectLastCall().andReturn(httpFields.getValues("content-type"));
                request.getHeaders(JettyHTTPDestinationTest.AUTH_HEADER);
                EasyMock.expectLastCall().andReturn(
                    httpFields.getValues(JettyHTTPDestinationTest.AUTH_HEADER));
                
                EasyMock.expect(request.getInputStream()).andReturn(is);
                request.setHandled(true);
                EasyMock.expectLastCall()
                response.flushBuffer();
View Full Code Here

                EasyMock.expect(request.getQueryString()).andReturn(query);   
                EasyMock.expect(request.getHeader("Accept")).andReturn("*/*")
                EasyMock.expect(request.getContentType()).andReturn("text/xml charset=utf8");
                EasyMock.expect(request.getAttribute("org.mortbay.jetty.ajax.Continuation")).andReturn(null);
               
                HttpFields httpFields = new HttpFields();
                httpFields.add("content-type", "text/xml");
                httpFields.add("content-type", "charset=utf8");
                httpFields.put(JettyHTTPDestinationTest.AUTH_HEADER, JettyHTTPDestinationTest.BASIC_AUTH);
               
                EasyMock.expect(request.getHeaderNames()).andReturn(httpFields.getFieldNames());
                request.getHeaders("content-type");
                EasyMock.expectLastCall().andReturn(httpFields.getValues("content-type"));
                request.getHeaders(JettyHTTPDestinationTest.AUTH_HEADER);
                EasyMock.expectLastCall().andReturn(
                    httpFields.getValues(JettyHTTPDestinationTest.AUTH_HEADER));
                
                EasyMock.expect(request.getInputStream()).andReturn(is);
                request.setHandled(true);
                EasyMock.expectLastCall()
                response.flushBuffer();
View Full Code Here

                EasyMock.expect(request.getQueryString()).andReturn(query);           
                EasyMock.expect(request.getHeader("Accept")).andReturn("*/*")
                EasyMock.expect(request.getContentType()).andReturn("text/xml charset=utf8");
                EasyMock.expect(request.getAttribute("org.mortbay.jetty.ajax.Continuation")).andReturn(null);
               
                HttpFields httpFields = new HttpFields();
                httpFields.add("content-type", "text/xml");
                httpFields.add("content-type", "charset=utf8");
                httpFields.put(JettyHTTPDestinationTest.AUTH_HEADER, JettyHTTPDestinationTest.BASIC_AUTH);
               
                EasyMock.expect(request.getHeaderNames()).andReturn(httpFields.getFieldNames());
                request.getHeaders("content-type");
                EasyMock.expectLastCall().andReturn(httpFields.getValues("content-type"));
                request.getHeaders(JettyHTTPDestinationTest.AUTH_HEADER);
                EasyMock.expectLastCall().andReturn(
                    httpFields.getValues(JettyHTTPDestinationTest.AUTH_HEADER));
                
                EasyMock.expect(request.getInputStream()).andReturn(is);
                request.setHandled(true);
                EasyMock.expectLastCall()
                response.flushBuffer();
View Full Code Here

                EasyMock.expect(request.getPathInfo()).andReturn("/foo");
                EasyMock.expect(request.getCharacterEncoding()).andReturn("UTF-8");
                EasyMock.expect(request.getQueryString()).andReturn(query);           
                EasyMock.expect(request.getContentType()).andReturn("text/xml charset=utf8");
               
                HttpFields httpFields = new HttpFields();
                httpFields.add("content-type", "text/xml");
                httpFields.add("content-type", "charset=utf8");
                httpFields.put(JettyHTTPDestinationTest.AUTH_HEADER, JettyHTTPDestinationTest.BASIC_AUTH);
               
                EasyMock.expect(request.getHeaderNames()).andReturn(httpFields.getFieldNames());
                request.getHeaders("content-type");
                EasyMock.expectLastCall().andReturn(httpFields.getValues("content-type"));
                request.getHeaders(JettyHTTPDestinationTest.AUTH_HEADER);
                EasyMock.expectLastCall().andReturn(
                    httpFields.getValues(JettyHTTPDestinationTest.AUTH_HEADER));
                
                EasyMock.expect(request.getInputStream()).andReturn(is);
                request.setHandled(true);
                EasyMock.expectLastCall()
                response.flushBuffer();
View Full Code Here

        long length=resource.length();
       
        if (response instanceof Response)
        {
            HttpFields fields = ((Response)response).getHttpFields();

            if (length>0)
                fields.putLongField(HttpHeaders.CONTENT_LENGTH_BUFFER,length);
               
            if (_cacheControl!=null)
                fields.put(HttpHeaders.CACHE_CONTROL_BUFFER,_cacheControl);
        }
        else
        {
            if (length>0)
                response.setHeader(HttpHeaders.CONTENT_LENGTH,TypeUtil.toString(length));
View Full Code Here

            response.setContentType(content.getContentType().toString());
       
        if (response instanceof Response)
        {
            Response r=(Response)response;
            HttpFields fields = r.getHttpFields();

            if (content.getLastModified()!=null
                fields.put(HttpHeaders.LAST_MODIFIED_BUFFER,content.getLastModified(),content.getResource().lastModified());
            else if (content.getResource()!=null)
            {
                long lml=content.getResource().lastModified();
                if (lml!=-1)
                    fields.putDateField(HttpHeaders.LAST_MODIFIED_BUFFER,lml);
            }
               
            if (count != -1)
                r.setLongContentLength(count);
View Full Code Here

                EasyMock.expect(request.getContextPath()).andReturn("/bar");
                EasyMock.expect(request.getPathInfo()).andReturn("/foo");
                EasyMock.expect(request.getQueryString()).andReturn(query);           
                EasyMock.expect(request.getContentType()).andReturn("text/xml charset=utf8");
               
                HttpFields httpFields = new HttpFields();
                httpFields.add("content-type", "text/xml");
                httpFields.add("content-type", "charset=utf8");
                httpFields.put(JettyHTTPDestinationTest.AUTH_HEADER, JettyHTTPDestinationTest.BASIC_AUTH);
               
                EasyMock.expect(request.getHeaderNames()).andReturn(httpFields.getFieldNames());
                request.getHeaders("content-type");
                EasyMock.expectLastCall().andReturn(httpFields.getValues("content-type"));
                request.getHeaders(JettyHTTPDestinationTest.AUTH_HEADER);
                EasyMock.expectLastCall().andReturn(
                    httpFields.getValues(JettyHTTPDestinationTest.AUTH_HEADER));
                
                EasyMock.expect(request.getInputStream()).andReturn(is);
                request.setHandled(true);
                EasyMock.expectLastCall()
                response.flushBuffer();
View Full Code Here

        private HttpFields responseFields;

        private CamelContentExchange(Exchange exchange, AsyncCallback callback) {
            this.exchange = exchange;
            this.callback = callback;
            responseFields = new HttpFields();
        }
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.HttpFields$Field

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.