/** * Return the <code>ServletRequest</code> for which this object * is the facade. This method must be implemented by a subclass. */ public HttpServletRequest getRequest() { if (facade == null) { facade = new RequestFacade(this); } return (facade); }
@Override public HttpSession getSession() { if (request == null) { throw new IllegalStateException(rb.getString(LogFacade.CANNOT_USE_REQUEST_OBJECT_OUTSIDE_SCOPE_EXCEPTION)); } return getSession(true); }
protected String determineMethodsAllowed(HttpServletRequest req) { StringBuilder allow = new StringBuilder(); // Start with methods that are always allowed allow.append("OPTIONS, GET, HEAD, POST"); // PUT and DELETE depend on readonly if (!readOnly) { allow.append(", PUT, DELETE"); } // Trace - assume disabled unless we can prove otherwise if (req instanceof RequestFacade && ((RequestFacade) req).getAllowTrace()) { allow.append(", TRACE"); } return allow.toString(); }
if (!maskDefaultContextMapping || !isDefaultContext) { if (facade == null) { facade = new RequestFacade(this); facade.getRequestFacadeHelper()); initRequestFacadeHelper = true; } else { if (defaultContextMaskingFacade == null) { defaultContextMaskingFacade = new RequestFacade(this, true); defaultContextMaskingFacade.getRequestFacadeHelper()); initRequestFacadeHelper = true;
facade.clear(); facade = null;
@Override public PushBuilder newPushBuilder() { ServletRequest current = getRequest(); while (current instanceof ServletRequestWrapper) { current = ((ServletRequestWrapper) current).getRequest(); } if (current instanceof RequestFacade) { return ((RequestFacade) current).newPushBuilder(this); } else { return null; } }
@Override protected boolean acceptWebSocket(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (!super.acceptWebSocket(req, resp)) { return false; } else { resp.setHeader("upgrade", "websocket"); resp.setHeader("connection", "upgrade"); } String key = req.getHeader("Sec-WebSocket-Key"); resp.setHeader("Sec-WebSocket-Accept", getWebSocketAccept(key)); WebApplication application = getApplication(); // Small hack until the Servlet API provides a way to do this. TomcatWebSocketProcessor webSocketHandler = new TomcatWebSocketProcessor(req, application); TomcatWebSocketProcessor.TomcatWebSocket tomcatWebSocket = webSocketHandler.new TomcatWebSocket(); // the request can be a wrapper from application servlet filters while (req instanceof HttpServletRequestWrapper) { req = (HttpServletRequest) ((HttpServletRequestWrapper) req).getRequest(); } ((RequestFacade) req).doUpgrade(tomcatWebSocket); return true; }
facade.clear(); facade = null;
@Override public PushBuilder newPushBuilder() { ServletRequest current = getRequest(); while (current instanceof ServletRequestWrapper) { current = ((ServletRequestWrapper) current).getRequest(); } if (current instanceof RequestFacade) { return ((RequestFacade) current).newPushBuilder(this); } else { return null; } } }
((RequestFacade) inner).doUpgrade(inbound); } else { resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
/** * Return the <code>ServletRequest</code> for which this object * is the facade. This method must be implemented by a subclass. */ public HttpServletRequest getRequest() { if (facade == null) { facade = new RequestFacade(this); } return facade; }
@Override public HttpSession getSession() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return getSession(true); }
protected String determineMethodsAllowed(HttpServletRequest req) { StringBuilder allow = new StringBuilder(); // Start with methods that are always allowed allow.append("OPTIONS, GET, HEAD, POST"); // PUT and DELETE depend on readonly if (!readOnly) { allow.append(", PUT, DELETE"); } // Trace - assume disabled unless we can prove otherwise if (req instanceof RequestFacade && ((RequestFacade) req).getAllowTrace()) { allow.append(", TRACE"); } return allow.toString(); }
@Override public PushBuilder newPushBuilder() { ServletRequest current = getRequest(); while (current instanceof ServletRequestWrapper) { current = ((ServletRequestWrapper) current).getRequest(); } if (current instanceof RequestFacade) { return ((RequestFacade) current).newPushBuilder(this); } else { return null; } }
facade.clear(); facade = null;
/* */ public HttpServletRequest getRequest() /* */ { /* 605 */ if (this.facade == null) { /* 606 */ this.facade = new RequestFacade(this); /* */ } /* 608 */ return this.facade; /* */ } /* */
@Override public HttpSession getSession() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return getSession(true); }
((RequestFacade) req).getAllowTrace()) { allow.append(", TRACE");
@Override public PushBuilder newPushBuilder() { ServletRequest current = getRequest(); while (current instanceof ServletRequestWrapper) { current = ((ServletRequestWrapper) current).getRequest(); } if (current instanceof RequestFacade) { return ((RequestFacade) current).newPushBuilder(this); } else { return null; } } }