根据后台Root得到显示的根节点
@param request HttpServletRequest
@throws Exception
@return ViewNode
763702
private ViewNode getRootViewNode(HttpServletRequest request) throws Exception {
    String rooNodeID = getRootNodeID(request);
    if (rooNodeID == null){
      Debug.logError("[JdonFramework] root Id is null ! " , module);
      return null;
    }
    Debug.logVerbose("[JdonFramework] get the tree's root Node: " + rooNodeID, module);
    ViewNode rNode = new ViewNode(rooNodeID, rooNodeID, true);
    rNode.setRoot(true);
    return rNode;
  }
1324845
@Override
	public String resolveLocaleCode(final HttpServletRequest request) {

		String localCode = null;
		if (request.getLocale() != Locale.getDefault()) {
			localCode = request.getLocale().toString();
		}

		return localCode;
	}
1027194
public static void bind(HttpServletRequest request) {
        if (request != null && threadLocal.get() != null) {
            throw new IllegalStateException("HttpServletRequestHolder.bind() called for a "
                    + "thread that already has a request associated with it. It's likely that the request "
                    + "was not correctly removed from the thread before it is put back into the thread pool.");
        }
        threadLocal.set(request);
    }
484638
public static boolean isInternalRequest(HttpServletRequest request){
		//
		if(Boolean.parseBoolean(request.getHeader(WebConstants.HEADER_INTERNAL_REQUEST))){
			return true;
		}

		boolean isInner = IpUtils.isInnerIp(request.getServerName());
		String forwardHost = request.getHeader(WebConstants.HEADER_FORWARDED_HOST);
		//来源于网关
		if(StringUtils.isNotBlank(forwardHost)){
			isInner = IpUtils.isInnerIp(StringUtils.split(forwardHost, ":")[0]);
		}else{			
			if(!isInner){
				isInner = IpUtils.isInnerIp(IpUtils.getinvokerIpAddr(request));
			}
		}
		return isInner;
	}
253191
public synchronized void create( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )
        throws Exception
    {
        reinitialize( request, response, servletContext );
        JavaControlUtils.initJavaControls( request, response, servletContext, this );
        onCreate();
    }
1241601
public static Map<String, Object> createRequestAttributesMap(HttpServletRequest request) {
        Map<String, Object> attributesMap = new HashMap<>();
        for (Enumeration attributeNameEnum = request.getAttributeNames(); attributeNameEnum.hasMoreElements(); ) {
            String attributeName = (String)attributeNameEnum.nextElement();

            attributesMap.put(attributeName, request.getAttribute(attributeName));
        }

        return attributesMap;
    }
416242
JsonNode requestResponse(final JsonNode request) {
        try {

            // write request
            String str = request.toString();
            this.stdin.write(str + "\n");
            this.stdin.flush();

            // read response
            JsonNode resp = readNextResponse();

            // throw if this is an error response
            if (resp.has("error")) {
                return processErrorResponse(resp);
            }

            // process synchronous callbacks (which 'interrupt' the response flow).
            if (resp.has("callback")) {
                return processCallbackResponse(resp);
            }

            // null "ok" means undefined result (or void).
            return resp.get("ok");

        } catch (IOException e) {
            throw new JsiiException("Unable to send request to jsii-runtime: " + e.toString(), e);
        }
    }
1272040
public static View resolveView(HttpServletRequest request, UrlMappingInfo info, String viewName, ViewResolver viewResolver) throws Exception {
        String controllerName = info.getControllerName();
        return WebUtils.resolveView(request, viewName, controllerName, viewResolver);
    }
724785
private DatanodeID[] getDatanodes(HttpServletRequest request)
  throws IOException {
    final String datanodes = request.getParameter("candidates");
    if (datanodes == null) {
      return null;
    }
    final String[] datanodeStrs = datanodes.split(" ");
    if (datanodeStrs.length == 0) {
      return null;
    }
    final DatanodeID[] dnIDs = new DatanodeID[datanodeStrs.length];
    for (int i=0; i<dnIDs.length; i++) {
      String hostName = datanodeStrs[i];
      int colon = datanodeStrs[i].indexOf(":");
      if (colon < 0) {
        throw new IOException("Invalid datanode name " + 
            datanodeStrs[i] + ", expecting name:port pair");
      } 
      hostName = datanodeStrs[i].substring(0, colon);
      int infoPort;
      try {
        infoPort = Integer.parseInt(datanodeStrs[i].substring(colon+1));
      } catch (NumberFormatException ne) {
        throw new IOException("Invalid datanode name " + 
            datanodeStrs[i] + ", expecting name:port pair", ne);
      }
      dnIDs[i] = new DatanodeID(hostName, null, infoPort, -1);
    }
    return dnIDs;
  }
789432
public static @Nullable Resource getContentResource(@NotNull HttpServletRequest request) {

    String contentPath = getContentPath(request);

    if (StringUtils.isNotEmpty(contentPath)) {
      SlingHttpServletRequest slingRequest = (SlingHttpServletRequest)request;
      return slingRequest.getResourceResolver().getResource(contentPath);
    }
    return null;
  }
627695
public static boolean isHttpPostRequest(HttpServletRequest request) {
        boolean isSane = isSaneRequest(request);
        boolean isPost = isSane && request.getMethod().equals(HttpMethod.POST.toString());
        return isSane && isPost;
    }
319208
protected StringBuffer getHeaderSection(HttpServletRequest request){
	
		StringBuffer sb = super.getHeaderSection(request);
		if(null != this.config.getDwrMapping()){
			sb.append(DWRParamWriter.buildDWRJSParams(request.getContextPath(),PathNormalizer.joinPaths(request.getContextPath(),  
																						 			this.config.getDwrMapping())));
			sb.append("if(!window.DWR)window.DWR={};\nDWR.loader = JAWR.loader;\n");
		}
		return sb;
	}
439263
public Object handle(Stru _cmd, HttpRequest request) throws Exception {
		try {
			Check.illegalargument.assertEquals(GET, request.getRequestLine().getMethod());
			Obj cmd = _cmd.asObj();
			@Nullable String path = cmd.getStr(CMD_PATH);
			String nameAndTx = cmd.getStrictStr(CMD_NAME);
			String ext = cmd.getStrictStr(CMD_EXT);
			int dotPos = nameAndTx.indexOf('.');
			String name = dotPos > 0 ? nameAndTx.substring(0, dotPos) : nameAndTx;
			String tx = dotPos > 0 ? nameAndTx.substring(dotPos + 1) : null;
			if (path != null) name = Uris.URIS.pathJoin(path, name);
			
			Tuple2<String, byte[]> foundImage = imageStore.get(name, ext);
			if (foundImage == null) {
				return HTTP.createBasicResponse(
					SC_NOT_FOUND,
					Obj.make("reason", statusToReason.get(SC_NOT_FOUND)).toString(),
					CT_APPLICATION_JSON_CS_UTF8);
			} else {
				ByteArrayEntity res;
				byte[] image = foundImage.get1();
				if (tx == null && fmtEquals(ext, foundImage.get0())) {
					res = new ByteArrayEntity(image);
				} else {
					ByteArrayOutputStream baos = new ByteArrayOutputStream();
					Tuple2<BufferedImage, String> biAndFmt = imageSizeFilter.readImageAndFormat(new ByteArrayInputStream(image));
					BufferedImage src = biAndFmt.get0();
					imageSizeFilter.resize(src, baos, ext, getWidthAndHeight(src.getWidth(), src.getHeight(), tx));
					res = new ByteArrayEntity(baos.toByteArray());
				}
				res.setContentType(fmt2contentType(ext));
				return res;
			}
		} catch (Exception e) {
			throw new Http500Exception(e);
		}
	}
819054
public static String readBody(HttpServletRequest request) {

        BufferedReader input = null;
        try {
            input = new BufferedReader(new InputStreamReader(request.getInputStream()));
            StringBuilder builder = new StringBuilder();
            String buffer;
            while ((buffer = input.readLine()) != null) {
                if (builder.length() > 0) {
                    builder.append("\n");
                }
                builder.append(buffer);
            }
            return builder.toString();
        } catch (IOException e) {
            log.info("http io exception : " + e.getMessage());
        }
        return null;
    }
88858
public static WSFederationRequest of(final HttpServletRequest request) {
        val wtrealm = request.getParameter(WSFederationConstants.WTREALM);
        val wreply = request.getParameter(WSFederationConstants.WREPLY);
        val wreq = request.getParameter(WSFederationConstants.WREQ);
        val wctx = request.getParameter(WSFederationConstants.WCTX);
        val wfresh = request.getParameter(WSFederationConstants.WREFRESH);
        val whr = request.getParameter(WSFederationConstants.WHR);
        val wresult = request.getParameter(WSFederationConstants.WRESULT);
        val relayState = request.getParameter(WSFederationConstants.RELAY_STATE);
        val samlResponse = request.getParameter(WSFederationConstants.SAML_RESPONSE);
        val state = request.getParameter(WSFederationConstants.STATE);
        val code = request.getParameter(WSFederationConstants.CODE);
        val wa = request.getParameter(WSFederationConstants.WA);
        val wauth = StringUtils.defaultIfBlank(request.getParameter(WSFederationConstants.WAUTH), "default");
        return new WSFederationRequest(wtrealm, wreply, wctx, wfresh, whr, wresult,
            relayState, samlResponse, state, code, wa, wauth, wreq);
    }
722777
public static PortalRequest unwrapPortalRequest(HttpServletRequest request) {
        do {
            if (request instanceof PortalRequest) {
                return (PortalRequest) request;
            } else if (request instanceof HttpServletRequestWrapper) {
                request = (HttpServletRequest) ((HttpServletRequestWrapper) request).getRequest();
            } else {
                return null;
            }
        } while (true);
    }
648621
public boolean actionInternalUse(HttpServletRequest request) {

        String internal = request.getParameter(PARAM_INTERNAL);

        CmsResource resource;
        boolean internalValue = false;
        if (internal != null) {
            internalValue = true;
        }
        try {
            resource = getCms().readResource(getParamResource(), CmsResourceFilter.ALL);

            int flags = resource.getFlags();

            if (internalValue) {
                flags |= CmsResource.FLAG_INTERNAL;
            } else {
                flags &= ~CmsResource.FLAG_INTERNAL;
            }

            getCms().lockResource(getParamResource());
            getCms().chflags(getParamResource(), flags);

        } catch (CmsException e) {
            m_errorMessages.add(key(Messages.ERR_MODIFY_INTERNAL_FLAG_0));
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage(), e);
            }
            return false;
        }
        return true;
    }