アノテーションインターフェース EnableSpringWebSession
@RetentionSE(RUNTIMESE)
@TargetSE(TYPESE)
@DocumentedSE
@Import(SpringWebSessionConfiguration.class)
public @interface EnableSpringWebSession
このアノテーションを
@Configuration
クラスに追加して、WebFlux アプリケーション用に WebSessionManager
を構成します。このアノテーションは、ReactiveSessionRepository
がアプリケーションコンテキストのどこかで定義されていることを前提としています。そうでない場合は、明確なエラーメッセージが表示されて失敗します。例:
@Configuration(proxyBeanMethods = false)
@EnableSpringWebSession
public class SpringWebFluxConfig {
@Bean
public ReactiveSessionRepository sessionRepository() {
return new ReactiveMapSessionRepository(new ConcurrentHashMap<>());
}
}
- 導入:
- 2.0