{
try
{
String pathSave = this.getPath();
this.setPath(nonProfiledPath);
ContentPage realPage = this.getPage();
this.setPage(null);
Map locators = null;
ProfileLocator locator = profiler.getProfile(this, ProfileLocator.PAGE_LOCATOR);
if ( locator != null )
{
locators = new HashMap();
locators.put(ProfileLocator.PAGE_LOCATOR, locator);
}
PortalSiteSessionContext sessionContext = (PortalSiteSessionContext)getSessionAttribute(ProfilerValveImpl.PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY);
String userPrincipal = ((getUserPrincipal() != null) ? getUserPrincipal().getName() : null);
PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, userPrincipal, true, true);
ContentPage cpage = new ContentPageImpl(requestContext.getManagedPage());
//System.out.println("page is " + cpage.getPath());
this.setPage(realPage);
this.setPath(pathSave);
return cpage;
}