// context also acts as a short term request cache for the
// selected page and built menus; however, creating the
// request context here does not select the page or build
// menus: that is done when the request context is
// accessed subsequently
PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, requestFallback, useHistory);
request.setAttribute(PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY, requestContext);
// additionally save request context under legacy key
// to support existing decorator access
request.setAttribute(PROFILED_PAGE_CONTEXT_ATTR_KEY, requestContext);
// get profiled page from portalsite request context
// and save profile locators map; accessing the request
// context here and in subsequent valves/decorators
// latently selects the page and builds menus from the
// user site view using the request context locators;
// the managed page accesed here is the raw selected page
// as returned by the PageManager component; accessing
// the managed page here selects the current page for the
// request
request.setPage(new ContentPageImpl(requestContext.getManagedPage()));
request.setProfileLocators(requestContext.getLocators());
request.setAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE,getPageActionAccess(request));
}
// continue