开发者

How to add listeners to JSF session initialization event?

开发者 https://www.devze.com 2023-02-19 07:34 出处:网络
I\'m writing a webapp that can be accessed through several different JSP pages. I\'m using Session scope since I assume that there can be seve开发者_StackOverflow社区ral different sessions active.

I'm writing a webapp that can be accessed through several different JSP pages. I'm using Session scope since I assume that there can be seve开发者_StackOverflow社区ral different sessions active.

If I knew I had one entry to the app I would has probably used the constructor of that bean as an initialization indicator but each JSP page uses a different Bean so I'm not sure how get the Session Initialized Event.

Any JSF Session Listeners that can be defined in faces-config.xml that I missed?

Thanks! (P.S - Working with JSF 1.2 Currently)


Sessions are not a JSF concept. They are a general web concept. Hence the servlet-api gives you the HttpSessionListener.sessionCreated(..). You should map it with <listener> in web.xml.


Maybe you're looking for a HttpSessionListener. See this example.

0

精彩评论

暂无评论...
验证码 换一张
取 消