本文整理汇总了Java中javax.servlet.http.HttpSessionContext类的典型用法代码示例。如果您正苦于以下问题:Java HttpSessionContext类的具体用法?Java HttpSessionContext怎么用?Java HttpSessionContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HttpSessionContext类属于javax.servlet.http包,在下文中一共展示了HttpSessionContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doFilterSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@Test
public void doFilterSessionContext() throws Exception {
doFilter(new DoInFilter() {
@Override
public void doFilter(HttpServletRequest wrappedRequest) {
HttpSessionContext sessionContext = wrappedRequest.getSession()
.getSessionContext();
assertThat(sessionContext).isNotNull();
assertThat(sessionContext.getSession("a")).isNull();
assertThat(sessionContext.getIds()).isNotNull();
assertThat(sessionContext.getIds().hasMoreElements()).isFalse();
try {
sessionContext.getIds().nextElement();
fail("Expected Exception");
}
catch (NoSuchElementException ignored) {
}
}
});
}
示例2: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@Override
public HttpSessionContext getSessionContext() {
touch();
final SessionManager component = SystemInstance.get().getComponent(SessionManager.class);
return new HttpSessionContext() {
@Override
public javax.servlet.http.HttpSession getSession(final String sessionId) {
final HttpSessionEvent event = component.findSession(sessionId);
return event == null ? null : event.getSession();
}
@Override
public Enumeration<String> getIds() {
return Collections.enumeration(component.findSessionIds());
}
};
}
示例3: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
/**
* Return the session context with which this session is associated.
*
* @deprecated As of Version 2.1, this method is deprecated and has no
* replacement. It will be removed in a future version of the
* Java Servlet API.
*/
public HttpSessionContext getSessionContext() {
if (sessionContext == null)
sessionContext = new StandardSessionContext();
return (sessionContext);
}
示例4: AcmeSession
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
AcmeSession(String id, int inactiveInterval, ServletContext servletContext, HttpSessionContext sessionContext) {
// new
// Exception("Session created with: "+servletContext).printStackTrace();
// //!!!
createTime = System.currentTimeMillis();
this.id = id;
this.inactiveInterval = inactiveInterval;
this.servletContext = servletContext;
this.sessionContext = sessionContext;
}
示例5: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@Override
public HttpSessionContext getSessionContext() {
return new HttpSessionContext() {
@Override
public HttpSession getSession(String s) {
return HttpSessionMock.this;
}
@Override
public Enumeration<String> getIds() {
return new Enumeration<String>() {
private boolean hasNext = true;
@Override
public boolean hasMoreElements() {
return hasNext;
}
@Override
public String nextElement() {
hasNext = false;
return getId();
}
};
}
};
}
示例6: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@Override
public HttpSessionContext getSessionContext() {
return null;
}
示例7: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@Override
public HttpSessionContext getSessionContext() {
return null;
}
示例8: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@Override
public HttpSessionContext getSessionContext() {
throw new RuntimeException("getSessionContext method not finished.");
}
示例9: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public HttpSessionContext getSessionContext() {
throw new IllegalStateException("As of Version 2.1, this method is deprecated and has no replacement.");
}
示例10: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
public HttpSessionContext getSessionContext() {
throw new UnsupportedOperationException();
}
示例11: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
public HttpSessionContext getSessionContext() {
return NOOP_SESSION_CONTEXT;
}
示例12: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
public HttpSessionContext getSessionContext()
{
return _delegate.getSessionContext();
}
示例13: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
public HttpSessionContext getSessionContext() {
return session.getSessionContext();
}
示例14: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
/**
* @deprecated no replacement.
**/
public HttpSessionContext getSessionContext() {
return null;
}
示例15: getSessionContext
import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@Override
public HttpSessionContext getSessionContext() {
return EMPTY_SESSION_CONTEXT;
}