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 2010/02/01 10:27:21 UTC
[Myfaces Wiki] Update of "Extensions/CDI/DevDoc/Drafts/ViewConversationScoped" by MarkStruberg
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.
The "Extensions/CDI/DevDoc/Drafts/ViewConversationScoped" page has been changed by MarkStruberg.
http://wiki.apache.org/myfaces/Extensions/CDI/DevDoc/Drafts/ViewConversationScoped?action=diff&rev1=2&rev2=3
--------------------------------------------------
- Extensions/CDI/DevDoc/Drafts/ViewConversationScoped
+ = @ViewConversationScoped context =
+ === Introduction ===
+
+ The standard context for the @ConversationScoped annotation in JSR-299 has the same lifespan like the @RequestScoped - it's a 'transient conversation'. This is until you start the conversation with conversation.begin(); or conversation.begin("yourowncid");. In this case the conversation will become longrunning and last until you either end() it or a few other criterias defined in the JSR-299 spec are met.
+
+ This means that a longrunning conversation can only be started after an action got invoked. But all page request to the view which happen ''before'' the action invocation will lead to creating the bean for each and every request over and over again. Imagine a failed validation on the page before the create() action on your backing bean can get invoked.
+
+ === Lifespan of a @ViewConversationScoped bean ===
+
+ Contrary to the the standard @ConversationScoped bean, the @ViewConversationScoped bean will have the @ViewScoped as base. This means the contextual instance will get created on the very first view impression and will be available on subsequent view invocations according to the rules of the standard @ViewScoped. The action has the possibility to get a ViewConversation object injected and start the conversation with begin() as known from the standard JSF-299 Conversation handling.
+
+ The contextual instance will get destroyed at the end of the request in which the conversation ends. Please note that this is different to the JSF @ViewScoped context which ends at the time you redirect/forward to another view, which is usually in the middle of a request!
+