/* (non-Javadoc)
@see com.ibm.ws.webcontainer.webapp.IWebAppDispatcherContext#initForNextDispatch(com.ibm.ws.webcontainer.core.Request)
517999
public void initForNextDispatch(IExtendedRequest req) //, WebAppRequestDispatcherInfo di)
    {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
            logger.logp(Level.FINE, CLASS_NAME,"initForNextDispatch", "req -> "+ req +" ,this -> " + this);
        }
        
        _request = req;
        if (req != null)
        {
            reqContext = ((SRTServletRequest)_request).getRequestContext();
        }
    }
1286142
@Override
	protected void preparePaintComponent(final Request request) {
		super.preparePaintComponent(request);

		List<AjaxTarget> targets = getTargets();
		if (targets != null && !targets.isEmpty()) {
			WComponent triggerComponent = trigger == null ? this : trigger;

			// The trigger maybe in a different context
			UIContext triggerContext = WebUtilities.getContextForComponent(triggerComponent);
			UIContextHolder.pushContext(triggerContext);

			// TODO The IDs of the targets are based on the Triggers Context. Not good for targets in repeaters
			try {
				List<String> targetIds = new ArrayList<>();
				for (AjaxTarget target : getTargets()) {
					targetIds.add(target.getId());
				}
				AjaxHelper.registerComponents(targetIds, triggerComponent.getId());
			} finally {
				UIContextHolder.popContext();
			}
		}
	}
566445
@Override
	protected void preparePaintComponent(final Request request) {
		if (!isInitialised()) {
			// Default some values.
			tf3.setDisabled(true);

			tf1.setText("blah blah");
			tf2.setText("abc");
			tf3.setText("abc");

			setInitialised(true);
		}
	}
438396
@Override
	public void preparePaintComponent(final Request request) {
		if (!this.isInitialised()) {
			List<String> dummyList = new ArrayList<>(2);
			dummyList.add("a");
			dummyList.add("b");

			repeater.setData(dummyList);

			this.setInitialised(true);
		}
	}
1289661
public synchronized void initialRequestDone() {
        initialRequestDone = true;
        if (previousAsyncContext != null) {
            previousAsyncContext.onAsyncStart(this);
            previousAsyncContext = null;
        }
        if (!processingAsyncTask) {
            processAsyncTask();
        }
        initiatingThread = null;
    }
453426
@Override
    public PortletDelegationDispatcher createRequestDispatcher(
            PortletRequest portletRequest, IPortletDefinitionId delegatePortletDefinitionId) {
        final HttpServletRequest request =
                this.portalRequestUtils.getPortletHttpRequest(portletRequest);

        final String windowID = portletRequest.getWindowID();
        final IPortletWindowId parentPortletWindowId =
                this.portletWindowRegistry.getPortletWindowId(request, windowID);

        final IPortletEntity delegatePortletEntity =
                this.portletEntityRegistry.getOrCreateDelegatePortletEntity(
                        request, parentPortletWindowId, delegatePortletDefinitionId);
        final IPortletEntityId delegatePortletEntityId = delegatePortletEntity.getPortletEntityId();

        final IPortletWindow delegatePortletWindow =
                this.portletWindowRegistry.createDelegatePortletWindow(
                        request, delegatePortletEntityId, parentPortletWindowId);

        final IPerson person = this.personManager.getPerson(request);
        final int userId = person.getID();

        return new PortletDelegationDispatcherImpl(
                delegatePortletWindow,
                userId,
                portalRequestUtils,
                personManager,
                portletRenderer,
                portalUrlProvider,
                portletDelegationManager);
    }
85020
@Override
	public void preparePaintComponent(final Request request) {
		if (!this.isInitialised()) {
			// Give the repeater the list of data to display.
			repeater.setData(fetchDataList());

			// Remember that we've done the initialisation.
			this.setInitialised(true);
		}
	}
1165621
public void initForNextResponse(IResponse res) {
		logger.logp(Level.FINE, CLASS_NAME,"initForNextResponse", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "initForNextResponse");
		
	}
10773
static void preHandleMultipartRequest(HttpServletRequest request)
        throws ServletException
    {
        MultipartRequestHandler multipartHandler = getCachedMultipartHandler(request);
        
        if (multipartHandler == null)
        {
            multipartHandler = getMultipartHandler(request);
            
            if (multipartHandler != null)
            {
                //
                // Run the request through the handler, and cache the handler in the outer request.
                //
                multipartHandler.handleRequest(request);
                HttpServletRequest outerRequest = ScopedServletUtils.getOuterRequest(request);
                outerRequest.setAttribute(PREHANDLED_MULTIPART_REQUEST_ATTR, multipartHandler);
            }
        }
    }
2747
@Override
  public InRequest newInRequest()
  {
    RequestHttp2 request = _freeRequest.allocate();
    
    if (request == null) {
      request = new RequestHttp2(_httpProtocol);
      /*
                                 connTcp(),
                                 _httpContainer,
                                 this);
                                 */
    }
    
    RequestBaratineImpl requestWeb = new RequestBaratineImpl(this,
                                                             request);
    //OutChannelHttp2 stream = request.getStreamOut();
    //stream.init(streamId, _outHttp);
    
    //request.init(this); // , _outHttp);
    
    return request;
  }
412001
@SuppressWarnings("unchecked")
	public void requestInitialized(ServletRequestEvent sre) {
		WebContext<HttpServletRequest> context = (WebContext<HttpServletRequest>) container.component(container.contexts().get(Request.class));
		context.associate((HttpServletRequest) sre.getServletRequest());
	}
1077531
public void init(HttpInboundConnection conn, RequestMessage req) {
        this.request = req;
        this.response = conn.getResponse();
        this.connection = conn;
        this.outStream = new ResponseBody(this.response.getBody());
        this.locale = Locale.getDefault();
    }
587403
public static void init(H.Request request, H.Response response) {
        H.Request.current(request);
        H.Response.current(response);
        resolveSession(request);
        resolveFlash(request);
    }
595085
public void dispatch(Request request, Response response) throws IOException, ServletException {
        onPreDispatch(request, response);
        onRouteDispatch(request, response);
        onPostDispatch(request, response);
    }
859558
@Override
	protected void preparePaintComponent(final Request request) {
		super.preparePaintComponent(request);

		if (isAjax() && UIContextHolder.getCurrent().getUI() != null) {
			AjaxTarget target = getAjaxTarget();
			AjaxHelper.registerComponent(target.getId(), getId());
		}

		String cacheKey = getListCacheKey();

		if (cacheKey != null) {
			LookupTableHelper.registerList(cacheKey, request);
		}
	}
421905
public PrefetchResponse prefetch(PrefetchRequest request) {
        InternalRequest internalRequest = this.createRequest(request, HttpMethodName.POST, CACHE, "prefetch");
        this.attachRequestToBody(request, internalRequest);
        return this.invokeHttpClient(internalRequest, PrefetchResponse.class);
    }
277942
public void reinitialize( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )
    {
        super.reinitialize( request, response, servletContext );
        
        if ( _pageInputs == null )
        {
            Map map = InternalUtils.getActionOutputMap( request, false );
            if ( map != null ) _pageInputs = Collections.unmodifiableMap( map );
        }
        
        //
        // Initialize the page flow field.
        //
        Field pageFlowMemberField = getCachedInfo().getPageFlowMemberField();
        
        // TODO: should we add a compiler warning if this field isn't transient?  All this reinitialization logic is
        // for the transient case.
        if ( fieldIsUninitialized( pageFlowMemberField ) )
        {
            PageFlowController pfc = PageFlowUtils.getCurrentPageFlow( request, servletContext );
            initializeField( pageFlowMemberField, pfc );
        }
        
        //
        // Initialize the shared flow fields.
        //
        CachedSharedFlowRefInfo.SharedFlowFieldInfo[] sharedFlowMemberFields =
                getCachedInfo().getSharedFlowMemberFields();
        
        if ( sharedFlowMemberFields != null )
        {
            for ( int i = 0; i < sharedFlowMemberFields.length; i++ )
            {
                CachedSharedFlowRefInfo.SharedFlowFieldInfo fi = sharedFlowMemberFields[i];
                Field field = fi.field;
                
                if ( fieldIsUninitialized( field ) )
                {
                    Map/*< String, SharedFlowController >*/ sharedFlows = PageFlowUtils.getSharedFlows( request );
                    String name = fi.sharedFlowName;
                    SharedFlowController sf =
                            name != null ? ( SharedFlowController ) sharedFlows.get( name ) : PageFlowUtils.getGlobalApp( request );
                    
                    if ( sf != null )
                    {
                        initializeField( field, sf );
                    }
                    else
                    {
                        _log.error( "Could not find shared flow with name \"" + fi.sharedFlowName
                                    + "\" to initialize field " + field.getName() + " in " + getClass().getName() );
                    }
                }
            }
        }
    }