{
subject = getSubject(request);
}
catch (Exception e1)
{
throw new PipelineException(e1.getMessage(), e1);
}
request.getRequest().getSession().setAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT, subject);
// set request context subject
request.setSubject(subject);
// Pass control to the next Valve in the Pipeline and execute under
// the current subject
final ValveContext vc = context;
final RequestContext rc = request;
PipelineException pe = (PipelineException) JSSubject.doAsPrivileged(subject, new PrivilegedAction()
{
public Object run()
{
try
{