4 Replies Latest reply on Sep 14, 2006 12:02 PM by Keith Naas

    conversational bean not always redirecting to ifNotBegunOutc

    Keith Naas Newbie

      This is probably my misunderstanding of the phases and conversations, but here it goes....

      We have a seam app with a lot of @Conversational beans. Many of these beans support wizards.

      If a user is on the nth page of one of the wizards, and the server was just bounced, I would expect the "Next" button to automatically redirect them to the "ifNotBegunOutcome" of the class associated with the "Next" buttons action method. However, in most scenarios, it lets the "Next" go through and the user is shown a nonsense wizard page filled with blanks.

      It appears that the problem has to do with the sequence of the the Conversational check and the instantiation of the components associated with the form post.

      Conversational checks only occur in the INVOKE_APPLICATION phase. If the Conversational bean does not exist in the conversation scope, it will redirect to the ifNotBegunOutcome. However, during the APPLY_REQUEST_VALUES phase, the Conversational beans have already bean instantiated by the SeamVariableResolver.

      For instance, in the log below, we are demonstrating what happens when we click the "Next" button on an action that uses the worksheetBean. I had just restarted the server (and thus the conversation was gone). Because the worksheetBean is instantiated by the SeamVariableResolver, the intended Conversational check never occurs.

      What can we do about this?

      2006-09-12 14:40:21,162 DEBUG [com.app.web.listener.LogPhaseListener] BEFORE: APPLY_REQUEST_VALUES(2)
      2006-09-12 14:40:21,240 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@b5d935, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@aacf63{ url=null ,addedOrder=0}
      2006-09-12 14:40:21,240 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@b5d935, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@15772e{ url=null ,addedOrder=0}
      2006-09-12 14:40:21,271 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: userPrincipal
      2006-09-12 14:40:21,271 DEBUG [org.jboss.seam.contexts.Contexts] found in application context: userPrincipal
      2006-09-12 14:40:21,271 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-09-12 14:40:21,271 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: userPrincipal
      2006-09-12 14:40:21,271 DEBUG [org.jboss.seam.contexts.Contexts] found in application context: userPrincipal
      2006-09-12 14:40:21,271 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-09-12 14:40:21,271 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: applicationMessages
      2006-09-12 14:40:21,271 DEBUG [org.jboss.seam.Component] instantiating Seam component: applicationMessages
      2006-09-12 14:40:21,271 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-09-12 14:40:21,287 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@b5d935, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1831292{ url=null ,addedOrder=0}
      2006-09-12 14:40:21,287 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: worksheetBean
      2006-09-12 14:40:21,287 DEBUG [org.jboss.seam.Component] instantiating Seam component: worksheetBean