replace old AbstractHttpConnection with HttpChannel to get request for session listener

This commit is contained in:
Jesse McConnell 2012-08-17 09:18:47 -05:00
parent 086e74bed8
commit 8c0897839a
1 changed files with 6 additions and 5 deletions

View File

@ -27,9 +27,9 @@ import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener; import javax.servlet.http.HttpSessionListener;
import org.eclipse.jetty.security.authentication.DeferredAuthentication; import org.eclipse.jetty.security.authentication.DeferredAuthentication;
import org.eclipse.jetty.server.AbstractHttpConnection;
import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.Authentication;
import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpChannel;
import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Response; import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.server.UserIdentity;
@ -300,12 +300,13 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
} }
public void sessionCreated(HttpSessionEvent se) public void sessionCreated(HttpSessionEvent se)
{ {
//if current request is authenticated, then as we have just created the session, mark it as secure, as it has not yet been returned to a user //if current request is authenticated, then as we have just created the session, mark it as secure, as it has not yet been returned to a user
AbstractHttpConnection connection = AbstractHttpConnection.getCurrentConnection(); HttpChannel channel = HttpChannel.getCurrentHttpChannel();
if (connection == null)
if (channel == null)
return; return;
Request request = connection.getRequest(); Request request = channel.getRequest();
if (request == null) if (request == null)
return; return;