开发者

RichFaces: Need to share JSF views across sessions

开发者 https://www.devze.com 2023-03-26 20:45 出处:网络
NOTE: I have a related question here (http://stackoverflow.开发者_JAVA百科com/questions/6915055/are-jsf-views-shared-between-users) but that deals with a few other issues, so I am creating this one to

NOTE: I have a related question here (http://stackoverflow.开发者_JAVA百科com/questions/6915055/are-jsf-views-shared-between-users) but that deals with a few other issues, so I am creating this one to focus on a more specific area.

I am using RichFaces (and in the last few weeks, have gotten a better feel for its implementation, object distribution, memory footprint, and things of that nature) along with JSR-168 Portlets, and am running into scalability issues. Given that a majority of my pages (aka, views) are user-agnostic (they are read-only, and generic to the user community for the most part), I want to force the RichFaces Framework to create a single view (# of logical views and sessions is set to 1 in web.xml) that is shared across the sessions.

In other words, I don't want any more than 1 view per session (easily, done by the config params mentioned above in web.xml) but more importantly, I don't want more than 1 view (of the same underlying view definition) even across sessions.

Now, what would it take to accomplish this?


I figured this one out. I extended the JBoss Portlet Bridge and JSF StateHolder classes (amongst other things) and have a custom implementation that lets me share the JSF views across user sessions (again, these views are read-only and generic to the user community). The ones that are session-specific, I just let those resort to the default behavior. This has helped cut the JSF contribution to the overall session size (in terms of memory) by about half.

0

精彩评论

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

关注公众号