Package org.eclipse.jetty.server

Examples of org.eclipse.jetty.server.AbstractHttpConnection


     */
    @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

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.