You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2005/08/05 19:28:00 UTC

[Myfaces Wiki] Update of "SaveState" by MikeKienenberger

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by MikeKienenberger:
http://wiki.apache.org/myfaces/SaveState

The comment on the change is:
changed save_state to saveState

------------------------------------------------------------------------------
      * Server restarting is a thrilling task: Will all objects in active sessions be serialized and restored successfully? If business classes have changed in the meantime, this task is likely to fail.
      * Running multiple redundant servers is a challenge. You must use cluster environments which are expensive and difficult to handle.
  
- MyFaces supports a different approach. It makes it possible to write sophisticated applications without any use of the HttpSession. All state information of the current view and the model beans can be encoded to the client response. MyFaces introduces a new Component "UISaveState" with the corresponding Tag <x:save_state>.
+ MyFaces supports a different approach. It makes it possible to write sophisticated applications without any use of the HttpSession. All state information of the current view and the model beans can be encoded to the client response. MyFaces introduces a new Component "UISaveState" with the corresponding Tag <x:saveState>.
  Example (see "sample1.jsp" of the "examples" web application):
  
  {{{
- <x:save_state id="save1" value="#{calcForm.number1}" />
+ <x:saveState id="save1" value="#{calcForm.number1}" />
- <x:save_state id="save2" value="#{calcForm.number2}" />
+ <x:saveState id="save2" value="#{calcForm.number2}" />
- <x:save_state id="save3" value="#{ucaseForm.text}" />
+ <x:saveState id="save3" value="#{ucaseForm.text}" />
  }}}            
  
  The current values of the three properties number1, number2 and text are automatically saved within the client response and get restored at the next client request.
@@ -23, +23 @@

  You can also save the whole bean.
  Example:
  
- <x:save_state id="saveCalcForm" value="#{calcForm}"/>
+ <x:saveState id="saveCalcForm" value="#{calcForm}"/>
              
  
  The whole bean automatically is saved and restored by MyFaces. To be able to save and restore the value of a bean property or the bean itself, it must implement one of the following:
@@ -40, +40 @@

  you simple set a 
  
  {{{
- <x:save_state id="save1" value="#{scopebean}" />
+ <x:saveState id="save1" value="#{scopebean}" />
  }}}
  
  on page 1
@@ -48, +48 @@

  then you do something which pushes you to page2
  
  {{{
- <x:save_state id="save1" value="#{scopebean}" />
+ <x:saveState id="save1" value="#{scopebean}" />
  }}}
  
  on page 2 should restore the entered data from page1 at the beginning of the phase cycles.