/* (non-Javadoc)
@see com.ibm.ws.webcontainer.core.RequestProcessor#handleRequest(com.ibm.ws.webcontainer.core.Request, com.ibm.ws.webcontainer.core.Response)
321533
public void handleRequest(ServletRequest req, ServletResponse res) throws Exception
	{
	    IServletWrapper target = this.cacheTarget;

	    if (target != null) {
	        try {
	            webapp.getFilterManager().invokeFilters((HttpServletRequest) req, (HttpServletResponse) res, webapp, target, CollaboratorHelper.allCollabEnum);
	        } catch (Throwable th){
	            if((com.ibm.ws.webcontainer.osgi.WebContainer.getServletContainerSpecLevel() >= 31) && th instanceof IOException){
	                if((th.getMessage()!= null) && th.getMessage().contains("SRVE0918E")){
	                    // dont do anything
	                    // we have already given chance to servlet and filters to handle it
	                    // this is application error but should not be returned to client.
	                    logger.logp(Level.FINE, CLASS_NAME, "handleRequest", "donothandleexception SRVE0918E");   
	                    return;
	                }
	            }
	            WebApp webapp = this.webapp;
	            if (webapp == null) {
	                FFDCFilter.processException(th, getClass().getName(), "83");
	            } else {
	                webapp.handleException(th, req, res, this);
	            }
	        }
	    }
	    else
	        throw InvalidCacheTargetException.instance();

	}
405981
public function handleRequest()
    {
        // Create the request very early so the ResourceManagement has a chance to grab it:
        $request = Request::createFromEnvironment();
        $response = new Response();
        $this->componentContext = new ComponentContext($request, $response);

        $this->boot();
        $this->resolveDependencies();
        $response = $this->addPoweredByHeader($response);
        $this->componentContext->replaceHttpResponse($response);
        $baseUriSetting = $this->bootstrap->getObjectManager()->get(ConfigurationManager::class)->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Flow.http.baseUri');
        if (!empty($baseUriSetting)) {
            $baseUri = new Uri($baseUriSetting);
            $request = $request->withAttribute(Request::ATTRIBUTE_BASE_URI, $baseUri);
            $this->componentContext->replaceHttpRequest($request);
        }

        $this->baseComponentChain->handle($this->componentContext);
        $response = $this->baseComponentChain->getResponse();

        $response->send();

        $this->bootstrap->shutdown(Bootstrap::RUNLEVEL_RUNTIME);
        $this->exit->__invoke();
    }
651398
private void handleRequest(long requestId, Object request, HandlerHolder handler) {
    @SuppressWarnings("unchecked")
    CompletableFuture<Object> responseFuture = handler.handler.apply(request);
    if (responseFuture != null) {
      responseFuture.whenComplete((response, error) -> {
        ThreadContext context = ThreadContext.currentContext();
        if (context == null) {
          this.context.executor().execute(() -> {
            if (error == null) {
              handleRequestSuccess(requestId, response, this.context);
            } else {
              handleRequestFailure(requestId, error, this.context);
            }
          });
        } else {
          if (error == null) {
            handleRequestSuccess(requestId, response, context);
          } else {
            handleRequestFailure(requestId, error, context);
          }
        }
      });
    }
  }
670254
@Override
	public void handleRequest(final Request request) {
		super.handleRequest(request);

		WComponent visibleDialog = getVisible();

		if (visibleDialog != null) {
			visibleDialog.serviceRequest(request);
		}
	}
1046146
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException
   {
      String action = request.getParameter(ACTION_PARAM);

      if (action == null)
         action = DISPLAY_MBEANS_ACTION;

      if (action.equals(DISPLAY_MBEANS_ACTION))
         displayMBeans(request, response);
      else if (action.equals(INSPECT_MBEAN_ACTION))
         inspectMBean(request, response);
      else if (action.equals(UPDATE_ATTRIBUTES_ACTION))
         updateAttributes(request, response);
      else if (action.equals(INVOKE_OP_ACTION))
         invokeOp(request, response);
      else if (action.equals(INVOKE_OP_BY_NAME_ACTION))
         invokeOpByName(request, response);
   }
1134217
@Override
	public void handleRequest(final Request request) {
		if (isDisabled()) {
			// Protect against client-side tampering of disabled/read-only fields.
			return;
		}

		if (isPresent(request)) {
			List<MenuItemSelectable> selectedItems = new ArrayList<>();
			// Unfortunately, we need to recurse through all the menu/sub-menus
			findSelections(request, this, selectedItems);
			setSelectedMenuItems(selectedItems);
		}
	}
300924
public static void handleStaticResourceRequest(final HttpServletRequest request,
			final HttpServletResponse response) {
		String staticRequest = request.getParameter(WServlet.STATIC_RESOURCE_PARAM_NAME);

		try {
			InternalResource staticResource = InternalResourceMap.getResource(staticRequest);
			boolean headersOnly = "HEAD".equals(request.getMethod());

			if (staticResource == null) {
				LOG.warn("Static resource [" + staticRequest + "] not found.");
				response.setStatus(HttpServletResponse.SC_NOT_FOUND);
				return;
			}

			InputStream resourceStream = staticResource.getStream();
			if (resourceStream == null) {
				LOG.warn(
						"Static resource [" + staticRequest + "] not found. Stream for content is null.");
				response.setStatus(HttpServletResponse.SC_NOT_FOUND);
				return;
			}

			int size = resourceStream.available();
			String fileName = WebUtilities.encodeForContentDispositionHeader(staticRequest.
					substring(staticRequest
							.lastIndexOf('/') + 1));

			if (size > 0) {
				response.setContentLength(size);
			}

			response.setContentType(WebUtilities.getContentType(staticRequest));
			response.setHeader("Cache-Control", CacheType.CONTENT_CACHE.getSettings());

			String param = request.getParameter(WContent.URL_CONTENT_MODE_PARAMETER_KEY);
			if ("inline".equals(param)) {
				response.setHeader("Content-Disposition", "inline; filename=" + fileName);
			} else if ("attach".equals(param)) {
				response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
			} else {
				// added "filename=" to comply with https://tools.ietf.org/html/rfc6266
				response.setHeader("Content-Disposition", "filename=" + fileName);
			}

			if (!headersOnly) {
				StreamUtil.copy(resourceStream, response.getOutputStream());
			}
		} catch (IOException e) {
			LOG.warn("Could not process static resource [" + staticRequest + "]. ", e);
			response.reset();
			response.setStatus(HttpServletResponse.SC_NOT_FOUND);
		}
	}
449182
private void handleSelectionRequest(final Request request) {
		String[] paramValue = request.getParameterValues(getId() + ".selected");

		if (paramValue == null) {
			paramValue = new String[0];
		}

		String[] selectedRows = removeEmptyStrings(paramValue);
		List<Integer> oldSelections = getSelectedRows();
		List<Integer> newSelections;

		boolean singleSelect = SelectMode.SINGLE.equals(getSelectMode());

		if (getDataModel().getRowCount() == 0) {
			newSelections = new ArrayList<>();
			selectedRows = new String[0];
		} else if (getPaginationMode() == PaginationMode.NONE
				|| getPaginationMode() == PaginationMode.CLIENT
				|| oldSelections == null) {
			newSelections = new ArrayList<>(selectedRows.length);
		} else if (singleSelect && selectedRows.length > 0) {
			// For single-select, we need to remove the old entries
			newSelections = new ArrayList<>(1);
		} else {
			// For multi-select, we need to entries for the current page only
			newSelections = new ArrayList<>(oldSelections);

			int startRow = getCurrentPageStartRow();
			int endRow = getCurrentPageEndRow();
			newSelections.removeAll(getRowIds(startRow, endRow));
		}

		for (String selectedRow : selectedRows) {
			try {
				newSelections.add(Integer.parseInt(selectedRow));

				if (singleSelect) {
					break;
				}
			} catch (NumberFormatException e) {
				LOG.warn("Invalid row id for selection: " + selectedRow);
			}
		}

		setSelectedRows(newSelections);

		// If there is a selection change action specified, it may need to be fired
		Action selectionChangeAction = getSelectionChangeAction();

		if (selectionChangeAction != null && !newSelections.equals(oldSelections)) {
			selectionChangeAction.execute(new ActionEvent(this, "selection"));
		}
	}
1198570
public boolean handle(ServerHttpRequest request, ServerHttpResponse response)
			throws IOException {
		for (HandlerMapper mapper : this.mappers) {
			Handler handler = mapper.getHandler(request);
			if (handler != null) {
				handle(handler, request, response);
				return true;
			}
		}
		return false;
	}
177014
public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws Exception {

		String requestedPath = (StringUtils.isEmpty(mapping)) ? helper
				.getPathWithinApplication(request) : helper
				.getPathWithinServletMapping(request);

		if (StringUtils.isNotEmpty(controllerMapping)) {
			requestedPath = requestedPath.substring(controllerMapping.length());
		}

		requestHandler.processRequest(requestedPath, request, response);
		return null;
	}
66200
protected void handleRequest(final HttpString method, HttpServerExchange exchange) throws Exception {
        final RequestData requestData = parseFormData(exchange);
        boolean persistent = exchange.isPersistent();
        exchange.setPersistent(false); //UNDERTOW-947 MCMP should not use persistent connections
        if (CONFIG.equals(method)) {
            processConfig(exchange, requestData);
        } else if (ENABLE_APP.equals(method)) {
            processCommand(exchange, requestData, MCMPAction.ENABLE);
        } else if (DISABLE_APP.equals(method)) {
            processCommand(exchange, requestData, MCMPAction.DISABLE);
        } else if (STOP_APP.equals(method)) {
            processCommand(exchange, requestData, MCMPAction.STOP);
        } else if (REMOVE_APP.equals(method)) {
            processCommand(exchange, requestData, MCMPAction.REMOVE);
        } else if (STATUS.equals(method)) {
            processStatus(exchange, requestData);
        } else if (INFO.equals(method)) {
            processInfo(exchange);
        } else if (DUMP.equals(method)) {
            processDump(exchange);
        } else if (PING.equals(method)) {
            processPing(exchange, requestData);
        } else {
            exchange.setPersistent(persistent);
            next.handleRequest(exchange);
        }
    }
1009250
public static RequestContext handle(final HttpServletRequest request, final HttpServletResponse response) {
        try {
            request.setCharacterEncoding("UTF-8");
            response.setCharacterEncoding("UTF-8");
        } catch (final Exception e) {
            LOGGER.log(Level.ERROR, "Sets request context character encoding failed", e);
        }

        final RequestContext ret = new RequestContext();
        ret.setRequest(request);
        ret.setResponse(response);
        Latkes.REQUEST_CONTEXT.set(ret);

        for (final Handler handler : HANDLERS) {
            ret.addHandler(handler);
        }

        ret.handle();
        result(ret);
        Latkes.REQUEST_CONTEXT.set(null);

        return ret;
    }
829939
@Override
	public void handleRequest(final Request request) {
		// Protect against client-side tampering of disabled/read-only fields.
		if (isDisabled() || isReadOnly()) {
			return;
		}

		RadioButtonGroup currentGroup = getGroup();

		// Check if the group is not on the request (do nothing)
		if (!currentGroup.isPresent(request)) {
			return;
		}

		// Check if the group has a null value (will be handled by the group handle request)
		if (request.getParameter(currentGroup.getId()) == null) {
			return;
		}

		// Get the groups value on the request
		String requestValue = currentGroup.getRequestValue(request);

		// Check if this button's value matches the request
		boolean onRequest = Util.equals(requestValue, getValue());

		if (onRequest) {
			boolean changed = currentGroup.handleButtonOnRequest(request);
			if (changed && (UIContextHolder.getCurrent() != null) && (UIContextHolder.getCurrent().getFocussed() == null)
					&& currentGroup.isCurrentAjaxTrigger()) {
				setFocussed();
			}
		}
	}
1087378
@Override
	public void handleRequest(final Request request) {
		super.handleRequest(request);

		// Check if window in request
		boolean targeted = isPresent(request);
		setTargeted(targeted);

		if (getState() == ACTIVE_STATE && isTargeted()) {
			getComponentModel().wrappedContent.serviceRequest(request);
		}
	}
881416
@Override
    public RequestCtx handleRequest(HttpServletRequest request,
                                    HttpServletResponse response)
            throws IOException, ServletException {
        RequestCtx req = null;

        Map<URI, AttributeValue> actions = new HashMap<URI, AttributeValue>();
        Map<URI, AttributeValue> resAttr;

        try {
            resAttr = ResourceAttributes.getRepositoryResources();

            actions.put(Constants.ACTION.ID.getURI(),
                        Constants.ACTION.GET_NEXT_PID
                                .getStringAttribute());
            actions.put(Constants.ACTION.API.getURI(),
                        Constants.ACTION.APIM.getStringAttribute());

            req =
                    getContextHandler().buildRequest(getSubjects(request),
                                                     actions,
                                                     resAttr,
                                                     getEnvironment(request));

            LogUtil.statLog(request.getRemoteUser(),
                            Constants.ACTION.GET_NEXT_PID.uri,
                            Constants.FEDORA_REPOSITORY_PID.uri,
                            null);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            CXFUtility.getFault(e);
        }

        return req;
    }
846950
public boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception {
        logRequest("Received SOAP request", messageContext, true);
        
        return true;
    }
1261435
@Override
    public void handleRequest(HttpServerExchange exchange) throws Exception {
        Account account = exchange.getSecurityContext().getAuthenticatedAccount();
        if (account != null && account.getPrincipal() instanceof JsonWebToken) {
            JsonWebToken token = (JsonWebToken)account.getPrincipal();
            PrincipalProducer myInstance = CDI.current().select(PrincipalProducer.class).get();
            myInstance.setJsonWebToken(token);
        }
        next.handleRequest(exchange);
    }