Sha256: 521f2b0a01f0df14384837423f60c911de1428b991b34d1753e9b84d446e4098

Contents?: true

Size: 754 Bytes

Versions: 13

Compression:

Stored size: 754 Bytes

Contents

module JettyRails
  module Handler
    
    class DelegateOnErrorsResponse
      include Java::JavaxServletHttp::HttpServletResponse
      
      def initialize(original, request)
        @original = original
        @request = request
      end
      
      def sendError(status_code)
        @request.handled = false
      end
      
      def method_missing(method, *args, &blk)
        @original.send(method, *args, &blk)
      end
    end
    
    class DelegateOnErrorsHandler < Jetty::Handler::HandlerWrapper
      def handle(target, request, response, dispatch)
        decorated_response = DelegateOnErrorsResponse.new(response, request)
        self.handler.handle(target, request, decorated_response, dispatch)
      end
    end
    
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
mikewadhera-jetty-rails-0.9.1 lib/jetty_rails/handler/delegate_on_errors_handler.rb
mikewadhera-jetty-rails-0.9.2 lib/jetty_rails/handler/delegate_on_errors_handler.rb
mikewadhera-jetty-rails-0.9.3 lib/jetty_rails/handler/delegate_on_errors_handler.rb
mikewadhera-jetty-rails-0.9 lib/jetty_rails/handler/delegate_on_errors_handler.rb
nolman-jetty-rails-0.9.6-jruby lib/jetty_rails/handler/delegate_on_errors_handler.rb
jetty-rails-0.8.1 lib/jetty_rails/handler/delegate_on_errors_handler.rb
jetty-rails-0.2 lib/jetty_rails/handler/delegate_on_errors_handler.rb
jetty-rails-0.3 lib/jetty_rails/handler/delegate_on_errors_handler.rb
jetty-rails-0.4 lib/jetty_rails/handler/delegate_on_errors_handler.rb
jetty-rails-0.5 lib/jetty_rails/handler/delegate_on_errors_handler.rb
jetty-rails-0.6 lib/jetty_rails/handler/delegate_on_errors_handler.rb
jetty-rails-0.8 lib/jetty_rails/handler/delegate_on_errors_handler.rb
jetty-rails-0.7 lib/jetty_rails/handler/delegate_on_errors_handler.rb