문제

Hi I have a bean and I want to define it as a CustomScoped Bean based on time, I mean I want to destroy the bean after a specific period of idle time. I mean if the user is not working with his/her own instance of the bean, the bean should be destroyed. Yes, each user needs to have its own instance, so it will be a kind of SessionScoped Bean which will be removed from Session after a while...

도움이 되었습니까?

해결책

This blog entry of the JSF 2.0 lead developer Ryan Lubke contains an example in flavor of a WAR.

다른 팁

If you can use CDI (JSR-299), you could use the Conversation Scope, make it long lived, and set the conversation timeout to your desired value. This would save you from having to write your own custom scope. As an added bonus, you get all the other great things that come with CDI.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top