/** * Get Request Attribute. * <p> * Also supports jetty specific attributes to gain access to Jetty APIs: * <dl> * <dt>org.eclipse.jetty.server.Server</dt><dd>The Jetty Server instance</dd> * <dt>org.eclipse.jetty.server.HttpChannel</dt><dd>The HttpChannel for this request</dd> * <dt>org.eclipse.jetty.server.HttpConnection</dt><dd>The HttpConnection or null if another transport is used</dd> * </dl> * While these attributes may look like security problems, they are exposing nothing that is not already * available via reflection from a Request instance. * @see javax.servlet.ServletRequest#getAttribute(java.lang.String) */ @Override public Object getAttribute(String name) { if (name.startsWith("org.eclipse.jetty")) { if (Server.class.getName().equals(name)) return _channel.getServer(); if (HttpChannel.class.getName().equals(name)) return _channel; if (HttpConnection.class.getName().equals(name) && _channel.getHttpTransport() instanceof HttpConnection) return _channel.getHttpTransport(); } return (_attributes == null)?null:_attributes.getAttribute(name); }
/** * Get Request Attribute. * <p> * Also supports jetty specific attributes to gain access to Jetty APIs: * <dl> * <dt>org.eclipse.jetty.server.Server</dt><dd>The Jetty Server instance</dd> * <dt>org.eclipse.jetty.server.HttpChannel</dt><dd>The HttpChannel for this request</dd> * <dt>org.eclipse.jetty.server.HttpConnection</dt><dd>The HttpConnection or null if another transport is used</dd> * </dl> * While these attributes may look like security problems, they are exposing nothing that is not already * available via reflection from a Request instance. * @see javax.servlet.ServletRequest#getAttribute(java.lang.String) */ @Override public Object getAttribute(String name) { if (name.startsWith("org.eclipse.jetty")) { if (Server.class.getName().equals(name)) return _channel.getServer(); if (HttpChannel.class.getName().equals(name)) return _channel; if (HttpConnection.class.getName().equals(name) && _channel.getHttpTransport() instanceof HttpConnection) return _channel.getHttpTransport(); } return (_attributes == null)?null:_attributes.getAttribute(name); }
/** * Get Request Attribute. * <p>Also supports jetty specific attributes to gain access to Jetty APIs: * <dl> * <dt>org.eclipse.jetty.server.Server</dt><dd>The Jetty Server instance</dd> * <dt>org.eclipse.jetty.server.HttpChannel</dt><dd>The HttpChannel for this request</dd> * <dt>org.eclipse.jetty.server.HttpConnection</dt><dd>The HttpConnection or null if another transport is used</dd> * </dl> * While these attributes may look like security problems, they are exposing nothing that is not already * available via reflection from a Request instance. * </p> * @see javax.servlet.ServletRequest#getAttribute(java.lang.String) */ @Override public Object getAttribute(String name) { if (name.startsWith("org.eclipse.jetty")) { if ("org.eclipse.jetty.server.Server".equals(name)) return _channel.getServer(); if ("org.eclipse.jetty.server.HttpChannel".equals(name)) return _channel; if ("org.eclipse.jetty.server.HttpConnection".equals(name) && _channel.getHttpTransport() instanceof HttpConnection) return _channel.getHttpTransport(); } return (_attributes == null)?null:_attributes.getAttribute(name); }
@Override public void badMessage(int status, String reason) { if (status < 400 || status > 599) status = HttpStatus.BAD_REQUEST_400; try { if (_state.handling()==Action.REQUEST_DISPATCH) { ByteBuffer content=null; HttpFields fields=new HttpFields(); ErrorHandler handler=getServer().getBean(ErrorHandler.class); if (handler!=null) content=handler.badMessageError(status,reason,fields); sendResponse(new ResponseInfo(HttpVersion.HTTP_1_1,fields,0,status,reason,false),content ,true); } } catch (IOException e) { LOG.debug(e); } finally { if (_state.unhandle()==Action.COMPLETE) _state.completed(); else throw new IllegalStateException(); } }
Throwable no_stack = unwrap(failure, BadMessageException.class, IOException.class, TimeoutException.class); if (quiet!=null || !getServer().isRunning())
HttpFields fields=new HttpFields(); ErrorHandler handler=getServer().getBean(ErrorHandler.class); if (handler!=null) content=handler.badMessageError(status,reason,fields);
HttpFields fields=new HttpFields(); ErrorHandler handler=getServer().getBean(ErrorHandler.class); if (handler!=null) content=handler.badMessageError(status,reason,fields);
request.setAttribute(RequestDispatcher.ERROR_REQUEST_URI, request.getRequestURI()); request.setAttribute(RequestDispatcher.ERROR_SERVLET_NAME, request.getServletName()); ErrorHandler error_handler = ErrorHandler.getErrorHandler(_channel.getServer(), contextHandler); if (error_handler!=null) error_handler.handle(null, request, request, this);
code>=SC_OK) ErrorHandler error_handler = ErrorHandler.getErrorHandler(_channel.getServer(),request.getContext()==null?null:request.getContext().getContextHandler()); if (error_handler!=null)
code>=SC_OK) ErrorHandler error_handler = ErrorHandler.getErrorHandler(_channel.getServer(),request.getContext()==null?null:request.getContext().getContextHandler()); if (error_handler!=null)
code>=SC_OK) ErrorHandler error_handler = ErrorHandler.getErrorHandler(_channel.getServer(),request.getContext()==null?null:request.getContext().getContextHandler()); if (error_handler!=null)
error_handler=context.getContextHandler().getErrorHandler(); if (error_handler==null) error_handler = _channel.getServer().getBean(ErrorHandler.class); if (error_handler!=null)
error_handler=context.getContextHandler().getErrorHandler(); if (error_handler==null) error_handler = _channel.getServer().getBean(ErrorHandler.class); if (error_handler!=null)