{
locators.put(ProfileLocator.PAGE_LOCATOR, profiler.getProfile(request, ProfileLocator.PAGE_LOCATOR));
}
// get profiled page context using the profiler and page manager
ProfiledPageContext profiledPageContext = profiler.createProfiledPageContext(locators);
pageManager.computeProfiledPageContext(profiledPageContext);
if (profiledPageContext.getPage() == null)
{
throw new NodeNotFoundException("Unable to profile request: " + request.getPath());
}
// set request page and profile locator
request.setPage(new ContentPageImpl(profiledPageContext.getPage()));
request.setProfileLocators(profiledPageContext.getLocators());
// return profiled page context in request attribute
HttpServletRequest httpRequest = request.getRequest();
httpRequest.setAttribute(PROFILED_PAGE_CONTEXT_ATTR_KEY, profiledPageContext);