brianchandotcom/liferay-portal — pull request #6775 by epgarcia (2012-09-05 14:08:49+00:00)
Title: LPS-29667 Use portal session context to redirect to error pages

We make sure we use the portalSession context for the redirection to the error pages. The portalSession is obtained from the PortalSessionThreadLocal, which has been set by the MainServlet or by the WebServerServlet. We need to check whether this value is null for those cases when it is not initialised, as in FriendlyURLServlet when the page is not found. In those cases, the request session context is always relative to the portal.