code: protected void prepareRequest() {
  		LOG.debug("Preparing for request by adding headers and environment to top wcomponent");
  
  		// Configure the UIContext to handle this request.
  		UIContext uiContext = getUIContext();
  
  		// Add WEnvironment if not already done.
  		// If the component is new, then it will not have a WEnvironment yet.
  		Environment env;
  
  		if (uiContext.isDummyEnvironment()) {
  			env = createEnvironment();
  			uiContext.setEnvironment(env);
  		} else {
  			env = uiContext.getEnvironment();
  		}
  
  		// Update the environment for the current phase of the request
  		// processing.
  		updateEnvironment(env);
  
  		// Prepare an implementation of a wcomponent Request suitable to the
  		// type of
  		// container we are running in.
  		if (getRequest() == null) {
  			setRequest(createRequest());
  		}
  
  		// Update the wcomponent Request for the current phase of the request
  		// processing.
  		updateRequest(getRequest());
  	}
docs: Prepare the session for the current request.