Discussion:
cdi execute code on session start
Matthew Broadhead
2018-05-07 15:10:48 UTC
Permalink
what is the best way to run code when a session is first created?  i
thought maybe a @PostConstruct inside a @Named @SessionScoped but it
doesn't trigger.
Romain Manni-Bucau
2018-05-07 16:18:27 UTC
Permalink
@WebListener on a HttpSessionListener?

otherwise @Observes @Initialiazed(SessionScoped.class) in the cdi bean


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>
what is the best way to run code when a session is first created? i
doesn't trigger.
Loading...