当前位置: 首页>>代码示例>>Java>>正文


Java HttpSessionContext类代码示例

本文整理汇总了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) {
			}
		}
	});
}
 
开发者ID:spring-projects,项目名称:spring-session,代码行数:22,代码来源:SessionRepositoryFilterTests.java

示例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());
        }
    };
}
 
开发者ID:apache,项目名称:tomee,代码行数:18,代码来源:HttpSessionImpl.java

示例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);

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:StandardSession.java

示例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;
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-listener,代码行数:11,代码来源:Serve.java

示例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();
				}
			};
		}
	};
}
 
开发者ID:caelum,项目名称:vraptor4,代码行数:28,代码来源:HttpSessionMock.java

示例6: getSessionContext

import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@Override
public HttpSessionContext getSessionContext() {
    return null;
}
 
开发者ID:onepiecex,项目名称:session-share,代码行数:5,代码来源:SessionImpl.java

示例7: getSessionContext

import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@Override
public HttpSessionContext getSessionContext() {
	return null;
}
 
开发者ID:XMBomb,项目名称:InComb,代码行数:5,代码来源:TestHttpSession.java

示例8: getSessionContext

import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@Override
public HttpSessionContext getSessionContext() {
    throw new RuntimeException("getSessionContext method not finished.");
}
 
开发者ID:yangfuhai,项目名称:jboot,代码行数:5,代码来源:JbootSessionWapperBase.java

示例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.");
}
 
开发者ID:geeker-lait,项目名称:tasfe-framework,代码行数:6,代码来源:HttpSessionImpl.java

示例10: getSessionContext

import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
public HttpSessionContext getSessionContext() {
    throw new UnsupportedOperationException();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:4,代码来源:HttpSessionStub.java

示例11: getSessionContext

import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
public HttpSessionContext getSessionContext() {
	return NOOP_SESSION_CONTEXT;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:4,代码来源:ExpiringSessionHttpSession.java

示例12: getSessionContext

import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
public HttpSessionContext getSessionContext()
{
  return _delegate.getSessionContext();
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:5,代码来源:CheckSerializationConfigurator.java

示例13: getSessionContext

import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
public HttpSessionContext getSessionContext() {
    return session.getSessionContext();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:StandardSessionFacade.java

示例14: getSessionContext

import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
/**
 * @deprecated no replacement.
 **/
public HttpSessionContext getSessionContext() {
    return null;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:ServletUnitHttpSession.java

示例15: getSessionContext

import javax.servlet.http.HttpSessionContext; //导入依赖的package包/类
@Override
public HttpSessionContext getSessionContext() {
    return EMPTY_SESSION_CONTEXT;
}
 
开发者ID:alexqdjay,项目名称:simple-session,代码行数:5,代码来源:Session.java


注:本文中的javax.servlet.http.HttpSessionContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。