返回当前邦定到当前线程的请求对象，如果没有则返回 portalNotWrapperRequest 请求对象
186936
public HttpServletRequest getRequest() {
        HttpServletRequest request = threadLocalRequests.get();
        return request == null ? orginal : request;
    }
25079
function getCorsAjaxTransport() {
        var xhrOrXdr;

        if (window.XMLHttpRequest || window.ActiveXObject) {
            xhrOrXdr = qq.createXhrInstance();

            if (xhrOrXdr.withCredentials === undefined) {
                xhrOrXdr = new XDomainRequest();
                // Workaround for XDR bug in IE9 - https://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9-f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handlers-not-specified?forum=iewebdevelopment
                xhrOrXdr.onload = function() {};
                xhrOrXdr.onerror = function() {};
                xhrOrXdr.ontimeout = function() {};
                xhrOrXdr.onprogress = function() {};
            }
        }

        return xhrOrXdr;
    }
973591
function(bidRequests) {
    let serverRequest = {
      p: [],
      page_url: utils.getTopWindowUrl(),
      bust: new Date().getTime().toString(),
      pr: utils.getTopWindowReferrer(),
      scrd: localWindow.devicePixelRatio || 0,
      dnt: getDNT(),
      e: getEnvironment(),
      description: getPageDescription(),
      title: localWindow.document.title || '',
      w: localWindow.innerWidth,
      h: localWindow.innerHeight
    };

    bidRequests.forEach((request) => {
      serverRequest.p.push(addPlacement(request));
      const userId = getUserId(request)
      if (userId) {
        const pubcid = userId.pubcid;
        serverRequest.pubcid = pubcid;
      } else if (request.crumbs) {
        serverRequest.pubcid = request.crumbs.pubcid;
      }
    });
    serverRequest.p = '[' + serverRequest.p.toString() + ']';
    return {
      method: 'GET',
      url: SERVER_ENDPOINT,
      data: serverRequest
    }
  }
744653
def get_request(self, request):
        """"""
        request.headers['authenticate'] = {
            'complexType': 'PortalLoginToken',
            'userId': self.user_id,
            'authToken': self.auth_token,
        }
        return request
1320009
function DOMRequest() {
  this.onsuccess = null;
  this.onerror = null;
  this.error = null;
  this.result = undefined;
  this.readyState = "pending";
}
650418
private PortalSearchResults getPortalSearchResults(PortletRequest request, String queryId) {
        final PortletSession session = request.getPortletSession();
        @SuppressWarnings("unchecked")
        final Cache<String, PortalSearchResults> searchResultsCache =
                (Cache<String, PortalSearchResults>)
                        session.getAttribute(SEARCH_RESULTS_CACHE_NAME);
        if (searchResultsCache == null) {
            return null;
        }

        return searchResultsCache.getIfPresent(queryId);
    }
195292
function(pMessage, pRequest, pResponse, fNext)
		{
			var tmpSessionID = null;
			if (pRequest.UserSession)
			{
				tmpSessionID = pRequest.UserSession.SessionID;
			}

			_Log.warn('API Error: '+pMessage, {SessionID: tmpSessionID, RequestID:pRequest.RequestUUID, RequestURL:pRequest.url, Action:'APIError'}, pRequest);
			pResponse.send({Error:pMessage});

			return fNext();
		}
1225166
protected HttpServletRequest getServletRequestFromExternalContext(
            ExternalContext externalContext) {
        Object request = externalContext.getNativeRequest();

        if (request instanceof PortletRequest) {
            return portalRequestUtils.getPortletHttpRequest(
                    (PortletRequest) externalContext.getNativeRequest());
        } else if (request instanceof HttpServletRequest) {
            return (HttpServletRequest) request;
        }

        // give up and throw an error
        else {
            throw new IllegalArgumentException(
                    "Unable to recognize the native request associated with the supplied external context");
        }
    }
1365737
function () {
        var data = this._conn._data;

        // if no requests are in progress, poll
        if (this._conn.authenticated && this._requests.length === 0 &&
            data.length === 0 && !this._conn.disconnecting) {
            Strophe.info("no requests during idle cycle, sending " +
                         "blank request");
            data.push(null);
        }

        if (this._conn.paused) {
            return;
        }

        if (this._requests.length < 2 && data.length > 0) {
            var body = this._buildBody();
            for (var i = 0; i < data.length; i++) {
                if (data[i] !== null) {
                    if (data[i] === "restart") {
                        body.attrs({
                            to: this._conn.domain,
                            "xml:lang": "en",
                            "xmpp:restart": "true",
                            "xmlns:xmpp": Strophe.NS.BOSH
                        });
                    } else {
                        body.cnode(data[i]).up();
                    }
                }
            }
            delete this._conn._data;
            this._conn._data = [];
            this._requests.push(
                new Strophe.Request(body.tree(),
                                    this._onRequestStateChange.bind(
                                        this, this._conn._dataRecv.bind(this._conn)),
                                    body.tree().getAttribute("rid")));
            this._throttledRequestHandler();
        }

        if (this._requests.length > 0) {
            var time_elapsed = this._requests[0].age();
            if (this._requests[0].dead !== null) {
                if (this._requests[0].timeDead() >
                    Math.floor(Strophe.SECONDARY_TIMEOUT * this.wait)) {
                    this._throttledRequestHandler();
                }
            }

            if (time_elapsed > Math.floor(Strophe.TIMEOUT * this.wait)) {
                Strophe.warn("Request " +
                             this._requests[0].id +
                             " timed out, over " + Math.floor(Strophe.TIMEOUT * this.wait) +
                             " seconds since last activity");
                this._throttledRequestHandler();
            }
        }
    }
1283950
@Override
  public void requestPollRead()
  {
    /*
    if (log.isLoggable(Level.FINEST)) {
      log.finest("request-wake " + getName()
                 + " (count=" + _port.getThreadCount()
                 + ", idle=" + _port.getIdleThreadCount() + ")");
    }
    */

    try {
      requestLoop();
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    }

    /*
    if (_stateRef.get().toWake(_stateRef)) {
      offer(getConnectionTask());
    }
    */
  }
875013
def mk_request_non(self, method, path):
        
        request = Request()
        request.destination = self.server
        request.code = method.number
        request.uri_path = path
        request.type = defines.Types["NON"]
        return request
1060783
private void handleRequest(
		ChainWriter out,
		WebSiteRequest req,
		HttpServletResponse resp,
		List<? extends TreePageData> tree,
		int scrollToX,
		int scrollToY,
		boolean[] opened
	) throws IOException, SQLException {
		WebPageLayout layout=getWebPageLayout(req);
		layout.startContent(out, req, resp, 1, getPreferredContentWidth(req));
		layout.printContentTitle(out, req, resp, this, 1);
		layout.printContentHorizontalDivider(out, req, resp, 1, false);
		layout.startContentLine(out, req, resp, 1, null, null);
		try {
			// Get the tree data
			int treeLen = tree.size();

			// Break apart each line
			String[][] paths = getLines(tree);

			if (opened == null) {
				// Default to opened for first item
				opened = new boolean[treeLen];
				if (treeLen > 0) opened[0] = true;
			}

			// Write the javascript that controls the form
			out.print("<script type='text/javascript'>\n"
					+ "  // <![CDATA[\n"
					+ "  function openNode(index) {\n"
					+ "    eval('document.forms[\"tree_form\"].opened_'+index+'.value=\"true\";');\n"
					+ "    document.forms[\"tree_form\"].scroll_to_x.value=getPageXOffset(window);\n"
					+ "    document.forms[\"tree_form\"].scroll_to_y.value=getPageYOffset(window);\n"
					+ "    document.forms[\"tree_form\"].submit();\n"
					+ "  }\n"
					+ "\n"
					+ "  function closeNode(index) {\n"
					+ "    eval('document.forms[\"tree_form\"].opened_'+index+'.value=\"false\";');\n"
					+ "    document.forms[\"tree_form\"].scroll_to_x.value=getPageXOffset(window);\n"
					+ "    document.forms[\"tree_form\"].scroll_to_y.value=getPageYOffset(window);\n"
					+ "    document.forms[\"tree_form\"].submit();\n"
					+ "  }\n"
					+ "  // ]]>\n"
					+ "</script>\n");

			// Write the form containing the current settings
			out.print("<form action='' id='tree_form' method='post'><div>\n");
			req.printFormFields(out, 1);
			out.print("  <input type='hidden' name='scroll_to_x' value='").print(scrollToX).print("' />\n"
					+ "  <input type='hidden' name='scroll_to_y' value='").print(scrollToY).print("' />\n");
			for(int c=0; c<treeLen; c++) {
				out.print("  <input type='hidden' name='opened_").print(c).print("' value='").print(opened[c]).print("' />\n");
			}

			// Display the tree in a table with links for opening/closing the different parts
			out.print("  <table cellspacing='0' cellpadding='0'>\n");

			String[] last = AoArrays.EMPTY_STRING_ARRAY;
			for (int c = 0; c < treeLen; c++) {
				String[] path = paths[c];
				int pathLen = path.length;

				// Every parent must be open for this to be visible
				boolean visible = true;
				Loop2 :
					for (int d = 0; d < (pathLen - 1); d++) {
						// Find the first row that has all the path up to current step
						for (int e = 0; e < c; e++) {
							String[] parentpath = paths[e];
							if (parentpath.length > d) {
								boolean isParent = true;
								for (int f = 0; f <= d; f++) {
									if (!parentpath[f].equals(path[f])) {
										isParent = false;
										break;
									}
								}
								if (isParent) {
									if (!opened[e]) {
										visible = false;
										break Loop2;
									}
									break;
								}
							}
						}
					}
					if (visible) {
						out.print("    <tr>\n"
								+ "      <td style='white-space:nowrap; border:0px;'><table cellspacing='0' cellpadding='0'><tr><td style='white-space:nowrap; border:0px;'>");

						int max = Math.min(pathLen - 1, last.length);
						int pos = 0;

						// Skip the part of the path that is already displayed by the parent
						for (; pos < max; pos++) {
							if (last[pos].equals(path[pos])) {
								boolean hasMore = false;
								for (int d = c + 1; d < treeLen; d++) {
									int end = pos;
									for (int e = 0; e < end; e++) {
										if (paths[d][e].equals(path[e])) {
											if (e == (end - 1) && !paths[d][end].equals(path[end])) {
												hasMore = true;
												break;
											}
										} else break;
									}
								}
								out.print("<img src='").encodeXmlAttribute(resp.encodeURL(req.getContextPath()+req.getURL(this, "image_num="+(hasMore?1:0)))).print("' style='border:0px; display:inline; vertical-align:bottom;' width='"+IMAGE_WIDTH+"' height='"+IMAGE_HEIGHT+"' alt='' />");
							} else break;
						}

						// Display the remaining part of the path
						for(; pos < pathLen; pos++) {
							if(path[pos].length()>0) {
								// Determine has sub items
								boolean hasSub = false;
								if (c < (treeLen - 1)) {
									String[] next_path = paths[c + 1];
									if (next_path.length >= pathLen) {
										hasSub = true;
										for (int e = 0; e < pathLen; e++) {
											String tempPath=path[e];
											if(tempPath.length()>0 && !tempPath.equals(next_path[e])) {
												hasSub = false;
												break;
											}
										}
									}
								}

								// Determine if the line continues farther down
								boolean hasMore = false;
								for (int d = c; d < treeLen; d++) {
									int end = pos;
									for (int e = 0; e < end; e++) {
										if (paths[d][e].equals(path[e])) {
											if (e == (end - 1) && !paths[d][end].equals(path[end])) {
												hasMore = true;
												break;
											}
										} else break;
									}
								}

								if(hasSub) {
									out
										.print("<a href='javascript:")
										.print(opened[c] ? "closeNode(" : "openNode(")
										.print(c)
										.print(");'><img alt='").print(opened[c] ? "Close" : "Open")
										.print("' src='")
										.encodeXmlAttribute(
											resp.encodeURL(
												req.getContextPath()+req.getURL(
													this,
													"image_num="+(
														opened[c]
														? (hasMore ? 4 : (c > 0 ? 5 : 9))
														: (hasMore ? 6 : (c > 0 ? 7 : 8))
													)
												)
											)
										).print("' style='vertical-align:bottom; border:0px; display:inline;' width='"+IMAGE_WIDTH+"' height='"+IMAGE_HEIGHT+"' /></a>");
								} else {
									out
										.print("<img src='")
										.encodeXmlAttribute(
											resp.encodeURL(
												req.getContextPath()+req.getURL(
													this,
													"image_num="+(hasMore ? 2 : 3)
												)
											)
										).print("' style='vertical-align:bottom; border:0px; display:inline;' width='"+IMAGE_WIDTH+"' height='"+IMAGE_HEIGHT+"' alt='' />");
								}
								out.print("<img src='").encodeXmlAttribute(resp.encodeURL(req.getContextPath()+req.getURL(this, "image_num=0"))).print("' style='vertical-align:bottom; border:0px; display:inline;' width='4' height='"+IMAGE_HEIGHT+"' alt='' /></td><td style='white-space:nowrap'>");
							}

							boolean useCodeFont=useCodeFont(req);
							if (useCodeFont) out.print("<code>");
							String href;
							if(
								(
									(pathLen>=2 && pos==(pathLen-2) && path[pathLen-1].length()==0)
									|| (pos==(pathLen-1) && path[pathLen-1].length()>0)
								) && (href = tree.get(c).getUrl()) != null
							) {
								out.print("<a class='aoLightLink' href='").encodeXmlAttribute(resp.encodeURL(href)).print("'>").print(path[pos]).print("</a>");
							} else if(path[pos].length()>0) out.print(path[pos]);
							if(useCodeFont) out.print("</code>");
						}

						out.print("</td></tr></table></td>\n"
								+ "      <td style='white-space:nowrap; width:20px'><img src='").encodeXmlAttribute(resp.encodeURL(req.getContextPath()+req.getURL(this, "image_num=0"))).print("' style='vertical-align:bottom; border:0px; display:inline;' width='20' height='1' alt='' /></td>\n"
								+ "      <td style='white-space:nowrap'>");
						String description=tree.get(c).getDescription();
						if(description!=null) out.print(description);
						out.print("</td>\n"
								+ "    </tr>\n");
						last = path;
					}
			}

			out.print("  </table>\n"
					+ "</div></form>\n");
		} finally {
			layout.endContentLine(out, req, resp, 1, false);
			layout.endContent(this, out, req, resp, 1);
		}
	}
1369267
private long getDefaultEmptyRequestDelay() {
        assertLocked();

        // Figure out how long we should wait before sending an empty request
        AttrRequests requests = cmParams.getRequests();
        long delay = EMPTY_REQUEST_DELAY;

        // Polling mode is used when REQ = 1, HOLD should be set to 0
        if (requests == null || requests.intValue() <= 1) {
            AttrPolling polling = cmParams.getPollingInterval();
            if (polling != null) {
                delay = polling.getInMilliseconds();
            }
        }
        return delay;
    }
637999
function (req) {
            // increment before assigning to avoid setting request id 0 (which does not work well with abort)
            this.nbRequests++;
            req.id = this.nbRequests;

            var reqMethods = ["GET", "POST", "PUT", "DELETE", "HEAD", "TRACE", "OPTIONS", "CONNECT", "PATCH", "COPY",
                    "PROPFIND", "MKCOL", "PROPPATCH", "MOVE", "LOCK", "UNLOCK", "BIND", "UNBIND", "REBIND"];
            // Assign a request timeout in order of importance:
            // # req.timeout - User specified timeout
            // # req.callback.timeout - Timeout of the callback function (might be set by filters)
            // # this.defaultTimeout - Default IO timeout
            if (req.timeout == null) {
                req.timeout = (req.callback == null || req.callback.timeout == null)
                        ? this.defaultTimeout
                        : req.callback.timeout;
            }

            if (!req.method) {
                req.method = "GET";
            } else {
                req.method = req.method.toUpperCase();
            }

            if (!(require("../utils/Array")).contains(reqMethods, req.method)) {
                return this.$logWarn("The request method %1 is invalid", [req.method]);
            }

            var headers = {};
            // First take the default IO headers
            for (var key in this.headers) {
                if (this.headers.hasOwnProperty(key)) {
                    headers[key] = this.headers[key];
                }
            }
            // Then add POST/PUT-specific headers
            if (req.method === "POST" || req.method === "PUT") {
                for (var key in this.postHeaders) {
                    if (this.postHeaders.hasOwnProperty(key)) {
                        headers[key] = this.postHeaders[key];
                    }
                }
            }
            // Then the headers from the request object
            for (var key in req.headers) {
                if (req.headers.hasOwnProperty(key)) {
                    headers[key] = req.headers[key];
                }
            }

            req.headers = headers;
        }
966431
@Override
    public boolean processParameters(HttpServletRequest request, HttpServletResponse response) {
        final IPortalRequestInfo portalRequestInfo =
                this.urlSyntaxProvider.getPortalRequestInfo(request);

        final IPortletWindowId targetedPortletWindowId =
                portalRequestInfo.getTargetedPortletWindowId();

        for (final IPortletRequestInfo portletRequestInfo :
                portalRequestInfo.getPortletRequestInfoMap().values()) {
            final IPortletWindowId portletWindowId = portletRequestInfo.getPortletWindowId();
            final IPortletWindow portletWindow =
                    this.portletWindowRegistry.getPortletWindow(request, targetedPortletWindowId);

            final UrlType urlType = portalRequestInfo.getUrlType();
            switch (urlType) {
                case RENDER:
                    {
                        final Map<String, List<String>> portletParameters =
                                portletRequestInfo.getPortletParameters();
                        portletWindow.setRenderParameters(
                                ParameterMap.convertListMap(portletParameters));

                        // fall through, render uses state/mode info
                    }
                case ACTION:
                    {
                        final WindowState windowState = portletRequestInfo.getWindowState();
                        if (windowState != null) {
                            portletWindow.setWindowState(windowState);
                        }

                        final PortletMode portletMode = portletRequestInfo.getPortletMode();
                        if (portletMode != null) {
                            portletWindow.setPortletMode(portletMode);
                        }

                        break;
                    }

                default:
                    // Do nothing
            }

            // Override the window state of the targeted portlet window based on the url state
            if (portletWindowId.equals(targetedPortletWindowId)) {
                final UrlState urlState = portalRequestInfo.getUrlState();
                switch (urlState) {
                    case MAX:
                        {
                            portletWindow.setWindowState(WindowState.MAXIMIZED);
                            break;
                        }
                    case DETACHED:
                        {
                            portletWindow.setWindowState(IPortletRenderer.DETACHED);
                            break;
                        }
                    case EXCLUSIVE:
                        {
                            portletWindow.setWindowState(IPortletRenderer.EXCLUSIVE);
                            break;
                        }
                    default:
                        // Do nothing
                }
            }

            this.portletWindowRegistry.storePortletWindow(request, portletWindow);
        }

        return true;
    }
92025
@Override
	public boolean incomingServerRequestMatchesMethod(RequestDetails theRequest) {
		if (!Constants.PARAM_HISTORY.equals(theRequest.getOperation())) {
			return false;
		}
		if (theRequest.getResourceName() == null) {
			return myResourceOperationType == RestOperationTypeEnum.HISTORY_SYSTEM;
		}
		if (!StringUtils.equals(theRequest.getResourceName(), myResourceName)) {
			return false;
		}

		boolean haveIdParam = theRequest.getId() != null && !theRequest.getId().isEmpty();
		boolean wantIdParam = myIdParamIndex != null;
		if (haveIdParam != wantIdParam) {
			return false;
		}

		if (theRequest.getId() == null) {
			return myResourceOperationType == RestOperationTypeEnum.HISTORY_TYPE;
		} else if (theRequest.getId().hasVersionIdPart()) {
			return false;
		}

		return true;
	}
1216185
function getRawRequest(context, excludedPreLoaders) {
    excludedPreLoaders = excludedPreLoaders || /eslint-loader/;
    return loaderUtils.getRemainingRequest({
        resource: context.resource,
        loaderIndex: context.loaderIndex,
        loaders: context.loaders.filter(loader => !excludedPreLoaders.test(loader.path))
    });
}