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


Java WebSessionManager类代码示例

本文整理汇总了Java中org.springframework.web.server.session.WebSessionManager的典型用法代码示例。如果您正苦于以下问题:Java WebSessionManager类的具体用法?Java WebSessionManager怎么用?Java WebSessionManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WebSessionManager类属于org.springframework.web.server.session包,在下文中一共展示了WebSessionManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: enableSpringWebSessionConfiguresThings

import org.springframework.web.server.session.WebSessionManager; //导入依赖的package包/类
@Test
public void enableSpringWebSessionConfiguresThings() {

	this.context = new AnnotationConfigApplicationContext();
	this.context.register(GoodConfig.class);
	this.context.refresh();

	WebSessionManager webSessionManagerFoundByType = this.context.getBean(WebSessionManager.class);
	Object webSessionManagerFoundByName = this.context.getBean(WebHttpHandlerBuilder.WEB_SESSION_MANAGER_BEAN_NAME);

	assertThat(webSessionManagerFoundByType).isNotNull();
	assertThat(webSessionManagerFoundByName).isNotNull();
	assertThat(webSessionManagerFoundByType).isEqualTo(webSessionManagerFoundByName);

	assertThat(this.context.getBean(ReactiveSessionRepository.class)).isNotNull();
}
 
开发者ID:spring-projects,项目名称:spring-session-data-mongodb,代码行数:17,代码来源:ReactiveMongoWebSessionConfigurationTest.java

示例2: webSessionManager

import org.springframework.web.server.session.WebSessionManager; //导入依赖的package包/类
/**
 * Configure a {@link WebSessionManager} using a provided {@link ReactiveSessionRepository}.
 *
 * @param repository a bean that implements {@link ReactiveSessionRepository}.
 * @return a configured {@link WebSessionManager} registered with a preconfigured name.
 */
@Bean(WebHttpHandlerBuilder.WEB_SESSION_MANAGER_BEAN_NAME)
public WebSessionManager webSessionManager(ReactiveSessionRepository<? extends Session> repository) {
	SpringSessionWebSessionStore<? extends Session> sessionStore = new SpringSessionWebSessionStore<>(repository);
	DefaultWebSessionManager manager = new DefaultWebSessionManager();
	manager.setSessionStore(sessionStore);

	if (this.webSessionIdResolver != null) {
		manager.setSessionIdResolver(this.webSessionIdResolver);
	}

	return manager;
}
 
开发者ID:spring-projects,项目名称:spring-session,代码行数:19,代码来源:SpringWebSessionConfiguration.java

示例3: webSessionManager

import org.springframework.web.server.session.WebSessionManager; //导入依赖的package包/类
@Bean
WebSessionManager webSessionManager() {
	return exchange -> Mono.just(mockWebSession);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-gateway,代码行数:5,代码来源:SaveSessionGatewayFilterFactoryTests.java


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