本文整理匯總了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;
}