Long Running Conversation Question
bdub Oct 22, 2009 6:13 PMI am having an issue with a new long running conversation being created when I don't expect it to be. I am using Seam 2.2.0.GA running on Glassfish 2.1. My example is as follows:
I have two pages. The first is a login page. Once the user has successfully authenticated the application redirects to second page called identify-feature. The identify-feature page contains a input text box, a command button (used for validating the data entered in the input text box), and a submit button which becomes enabled after the data entered in the input text box is validated. When the identify-feature page is initially rendered a new long running conversation is created as I expect. What I don't understand is why a second long running conversation is created when the validate command button is pressed and the identify-feature page is re-rendered.
My pages.xml looks as follows:
<?xml version="1.0" encoding="UTF-8"?> <pages xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd" no-conversation-view-id="/login.xhtml" login-view-id="/login.xhtml" > <page view-id="*"> <navigation from-action="#{identity.logout}"> <end-conversation /> <redirect view-id="/login.xhtml" /> </navigation> </page> <page view-id="/login.xhtml" action="#{identity.isLoggedIn}"> <navigation from-action="#{identity.isLoggedIn}"> <rule if-outcome="true"> <redirect view-id="/identify-feature.xhtml" /> </rule> </navigation> <navigation> <rule if="#{identity.loggedIn}"> <redirect view-id="/identify-feature.xhtml" /> </rule> </navigation> </page> <page view-id="/identify-feature.xhtml" login-required="true" > <begin-conversation join="true"/> </page> </pages>
The identify-feature.xhtml is defined as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:s="http://jboss.com/products/seam/taglib"> <body> <ui:composition template="/template.xhtml"> <ui:define name="title">#{msgs.identifyFeatureStep}</ui:define> <ui:define name="contents"> <h:form id="identifyFeature"> <h:panelGroup styleClass="formInput"> <h:outputLabel id="featureNumberLabel" for="feature" value="#{msgs.featureNumber}" styleClass="formSectionTitle" /> <h:inputText id="feature" value="#{featurePageBean.featureNumber}" tabindex="0" required="true" validator="#{featurePageBean.validateFeature}" converterMessage="#{msgs.featureNumberError}" requiredMessage="#{msgs.featureRequired}"> <f:validateLongRange minimum="1" maximum="9999999" /> </h:inputText> <h:commandButton value="#{msgs.validate}" type="submit" /> <h:message styleClass="errorMsg" for="feature" /> </h:panelGroup> </h:form> <br /> <h:form id="featureButtons"> <div class="wizardButtons"><h:commandButton value="#{msgs.next}" type="submit" action="next" disabled="#{feature == null}" /></div> </h:form> </ui:define> </ui:composition> </body> </html>
The declaration of the FeaturePageBean is as follows:
@Name("featurePageBean") @Scope(ScopeType.CONVERSATION) public class FeaturePageBean implements Serializable
I would appreciate any assistance/direction/explanation you could provide.