开发者

Creating a custom scope with a fixed period of existence

开发者 https://www.devze.com 2023-02-18 13:11 出处:网络
I am working with an existing Web system using JSF and we are upgrading to JSF 2.0. Now we use t:saveState supplied by Tomohawk library to persist beans between requests. But, unfortunately, it is the

I am working with an existing Web system using JSF and we are upgrading to JSF 2.0. Now we use t:saveState supplied by Tomohawk library to persist beans between requests. But, unfortunately, it is the only usage of the library so we have decided to get rid of it. There are quite a few alternatives I have stumbled across. Custom scopes is one of them. But I have been searching the internet and it doesn't strike me as a good choice since it has been recently released and documented quite mediocre. Now I tend to use a SessionMap to store parameters. But, for example, as soon as bean goes out of certain pages I want values bound not to bereferenced any longer. Adjusted view scope, so to speak. And I would like it to use JSF 2.0 abilities at full. Elegance is also not a last thing on my mind) Could you share some thoughts with me how to do that? Thank you so much i开发者_如何学JAVAn advance. Also I would like to thank BalusC for an impressive article he has written. It has helped me immensely. Here is the link: http://balusc.blogspot.com/2006/06/communication-in-jsf.html


I was searching for articles dealing with custom scopes and could not find any useful information. I was playing around with the feature und finally got a working solution that I am now happy to share with others :-)

JSF 2 Custom Scopes without 3rd party libraries

I know its kind of late for an answer but I hope this is helpful anyway


I haven't used Tomohawk, but a quick look at the t:saveState docs sounds alot like flash scope

0

精彩评论

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

关注公众号