开发者

JSF: Should I keep the data list of dataTable in SessionScoped bean or ViewScoped bean

开发者 https://www.devze.com 2023-01-21 04:29 出处:网络
Can you guys give me opinion on these scenario: 1. data list is large and update quite often 2. data list is small开发者_运维问答 and does not update that often

Can you guys give me opinion on these scenario:

1. data list is large and update quite often

2. data list is small开发者_运维问答 and does not update that often

3. any other interesting case that you guys think a noob like me should know


Always prefer view scope to session scope. In the general case the data in a dataTable is not session-wide, it is for the current view.

You can use the session as some sort of cache, but that cache better be in another place - i.e. between your application and your storage.

0

精彩评论

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