本文整理汇总了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;
}
示例3: webSessionManager
import org.springframework.web.server.session.WebSessionManager; //导入依赖的package包/类
@Bean
WebSessionManager webSessionManager() {
return exchange -> Mono.just(mockWebSession);
}