This works. It is simple and seems efficient. Check the viewId, check the object state, then do nothing or forward to the appropriate page.
Mike --- Mike Duffy <[EMAIL PROTECTED]> wrote: > Rather than using SEAM or Spring WebFlow, I am wondering if it might be > possible to use a > PhaseListener to create a simplified page flow. > > By using > > facesContext.getViewRoot().getViewId(); > > it is possible to determine what page the user has landed on. > > By using > > facesContext.getApplication().getVariableResolver().resolveVariable(facesContext, > "objectReference"); > > it is possible to get any object in the session. > > In most cases, when you have a PageFlow, when a user gets to a specific page, > there is a > requirement that an object or objects (usually held in session scope) be in a > specific state. > If > the state of the object(s) is incorrect, the phase listener can easily > forward to a new page by > using > > facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext, > "", "new > nav" > ); > > It would even be possible to externalize the state conditions used by the > PhaseListener into an > XML file similar to a WebFlow "definition" > (http://www.theserverside.com/tt/articles/article.tss?l=SpringWebFlow). > > Am I being naive? > > Please share your thoughts. > > Mike > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

