title: JSF 2.0 - Possibilities of bean scopes
body: <p>I posted a couple of questions but haven't gotten any reply yet. Everything I state here concerns JSF 2.0.* mostly.</p>
  
  <p>A typical bean contains information to be displayed on a page. Common business web-based application is a set of pages where each of them involves view-edit-save state which are represented by several xhtml pages. So we create a single bean to manage those states. But there are several problems I will describe shortly:</p>
  
  <p>1) <strong>Each page is a different view thus forcing you to place bean into a session scope</strong>. It takes its toll in bloating the session storage.<br>
  2) <strong>Passing parameters between views</strong>. In order to edit a document one should know ID of the document or/and another set of objects. Placing them into a session is not a good decision (bloated session antipattern).</p>
  
  <p>So far several attempts to rectify a situation have been tried. </p>
  
  <p>a) <strong>t:saveState</strong>. It has been doing its job for many years. But now we are getting rid of it.
  b) <strong>Seam conversation</strong>. It has imposed so many problems concerning an exact moment the conversation dies. Time out is not an easy parameter to be set since we don't know how long a business user will, for example, be editing a document. Not a solution for us.<br>
  c) <strong>CODI(not tried)</strong> It seems to be a nice JSR 299 implementation and, potentilly can solve all out problems but it is so scarcely documented and, since being an extension, sticks to the WELD which is another framework and we just want to use all the power of JSF.<br>
  d) <strong>Spring web flow</strong>. Well, it is a very nice framework, documented abundantly, great IOC container, flow scope and all other nice things it provides can be a remedy. It solves <strong>multiply tab problem</strong>(it is my wording, so forgive me if it is unclear what I am getting at). Imagine we have an edit page and view scoped bean and we are filling the form. If users opens another page in a new tab, GET request is fired and the bean goes out of scope. Web flow can recognise such a problem and starts a new flow if a new tab has been opened.</p>
  
  <p>(continuation on Web Flow)But it is monolithic and will force us to rewrite the whole project. Yes, I know it supports JSF and I have tested and fumbled with it for a little while to see whether it fits the bill or not. It doesn't because of its security. Unfortunately we don't have time nor resources to build a new project from scratch.</p>
  
  <p>We have almost run out of solutions. JSF is a great framework, has been tested extensively and used in many projects. But the developers refuse to include CDI in it.</p>
  
  <p>Can anyone recommend any solution to edit-view-save problem with a single bean? Any architectural advice will be of great help. Thank you so much in advance.</p>