Add changeSessionId() method in preparation for servlet-3.1
This commit is contained in:
parent
3acf2e65ed
commit
605df36577
|
@ -68,6 +68,7 @@ import org.eclipse.jetty.http.HttpVersion;
|
|||
import org.eclipse.jetty.http.MimeTypes;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler.Context;
|
||||
import org.eclipse.jetty.server.session.AbstractSessionManager;
|
||||
import org.eclipse.jetty.util.Attributes;
|
||||
import org.eclipse.jetty.util.AttributesMap;
|
||||
import org.eclipse.jetty.util.MultiMap;
|
||||
|
@ -1162,6 +1163,21 @@ public class Request implements HttpServletRequest
|
|||
return _channel.getResponse();
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/*
|
||||
* Add @override when 3.1 api is available
|
||||
*/
|
||||
public String changeSessionId()
|
||||
{
|
||||
HttpSession session = getSession(false);
|
||||
if (session == null)
|
||||
throw new IllegalStateException("No session");
|
||||
|
||||
AbstractSessionManager.renewSession(this, session, getRemoteUser()!=null);
|
||||
|
||||
return session.getId();
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/*
|
||||
* @see javax.servlet.http.HttpServletRequest#getSession()
|
||||
|
|
Loading…
Reference in New Issue