當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。