title: Can't access bean properties of model object across Spring webflow views
body: <p>I've looked through numerous articles and posts on stack overflow, but can't seem to find my solution to this (including this <a href="https://stackoverflow.com/questions/14630546/sharing-object-across-screens-using-spring-webflow">post</a>).  I'm new to Spring (and webflow) but not to Java.</p>
  
  <p>I have form pages using Spring Webflow 2.3.2, the input data for which I simply want to persist using Hibernate3 to MySQL5.  The problem is, I don't see values from the model (rentalApplication) persisting between pages.  I will post the relevant code but if there's more detail needed, I can update accordingly. </p>
  
  <p><strong>flow.xml:</strong></p>
  
  <pre><code>&lt;flow xmlns="http://www.springframework.org/schema/webflow"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
      http://www.springframework.org/schema/webflow 
      http://www.springframework.org/schema/webflow/spring-webflow.xsd"&gt;
  
    &lt;on-start&gt;
      &lt;evaluate expression="rentalApplicationController.newForm()" result="flowScope.rentalApplication" /&gt;
    &lt;/on-start&gt;
  
    &lt;view-state id="rentalapp1" view="embeddedFlow/rentalapp1" model="rentalApplication"&gt;
      &lt;transition on="next" to="rentalapp2"&gt;
        &lt;evaluate
        expression="rentalApplicationController.update(rentalApplication)"
        result="flowScope.rentalApplication"/&gt;
      &lt;/transition&gt;
      &lt;transition on="cancel" to="cancel" bind="false" history="discard"/&gt;
      &lt;transition on="save" to="save"&gt;
        &lt;evaluate
        expression="rentalApplicationController.update(rentalApplication)"
        result="flowScope.rentalApplication"/&gt;
      &lt;/transition&gt;
    &lt;/view-state&gt;
  
    &lt;view-state id="rentalapp2" view="embeddedFlow/rentalapp2" model="rentalApplication"&gt;
      &lt;transition on="previous" to="rentalapp1" validate="false"/&gt;
      &lt;transition on="next" to="rentalapp3"&gt;
        &lt;evaluate
        expression="rentalApplicationController.update(rentalApplication)"
        result="flowScope.rentalApplication"/&gt;
       &lt;/transition&gt;
      &lt;transition on="save" to="save"&gt;
        &lt;evaluate
        expression="rentalApplicationController.update(rentalApplication)"
        result="flowScope.rentalApplication"/&gt;
      &lt;/transition&gt;
  </code></pre>
  
  <p>
        ...</p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>@Service(value="rentalApplicationController")
  public class RentalApplicationController extends FormAction {
  
      public RentalApplication newForm() {
      return rentalApplicationDao.create();
      }
  
      public RentalApplication update(RentalApplication rentalApp) {
      rentalApplicationDao.update(rentalApp);
  
      //not the best way to do this, but making sure we get
      //the updated data from the db
      int id = rentalApp.getId();
      return rentalApplicationDao.retrieve(id);
      }
  }
  </code></pre>
  
  <p><strong>Config:</strong></p>
  
  <pre><code>  &lt;bean id="formAction"
      class="com.foo.bar.RentalApplicationController"&gt;
    &lt;/bean&gt;
    &lt;bean id="primaryApplicant"
      class="com.foo.bar.account.Applicant"
      scope="session"&gt;
    &lt;/bean&gt;
    &lt;bean id="coApplicant"
      class="com.foo.bar.account.Applicant"
      scope="session"&gt;
    &lt;/bean&gt;
    &lt;bean id="rentalApplication"
      class="com.foo.bar.property.RentalApplication"
      scope="session"&gt;
    &lt;/bean&gt;
  &lt;bean name="formAction" class="com.foo.bar.RentalApplicationController"&gt;
      &lt;property name="formObjectName"&gt;&lt;value&gt;rentalApplication&lt;/value&gt;&lt;/property&gt;
      &lt;property name="formObjectClass"&gt;&lt;value&gt;com.foo.bar.RentalApplication&lt;/value&gt;     &lt;/property&gt;
      &lt;property name="validator"&gt;
        &lt;bean class="com.foo.bar.RentalApplicationValidator"/&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p><strong>DAO implementation:</strong></p>
  
  <pre><code>@Repository
  @Transactional
  @Service("rentalApplicationService")
  
  public class RentalApplicationDaoImpl extends HibernateDaoSupport implements RentalApplicationDao {
  
      public RentalApplication create() {
      return new RentalApplication();
      }
  
      public void update(RentalApplication rentalApplication) {
          this.getHibernateTemplate().saveOrUpdate(rentalApplication);
      }
  
      public RentalApplication retrieve(int id) {
          return (RentalApplication)   getHibernateTemplate().getSessionFactory().getCurrentSession().get(RentalApplication.class, id);
      }
  </code></pre>
  
  <p><strong>POJOS:</strong></p>
  
  <pre><code>@Entity 
  @Table(name="RENTAL_APPLICATION")
  public class RentalApplication implements Serializable {
  
      public RentalApplication() {
         this.setDateCreated(Calendar.getInstance().getTime());
         this.setPrimaryApplicant(new Applicant());
         this.setCoApplicant(new Applicant());
      }
  }
  
  @Entity
  @DiscriminatorValue("APPLICANT")
  public class Applicant implements Serializable {
      //getters and setters including the one for email
  }
  </code></pre>
  
  <p><strong>rentalapp1 JSP:</strong></p>
  
  <pre><code>&lt;form:form id="rentalapp1" commandName="rentalApplication" action="${flowExecutionUrl}" method="POST"&gt;
  &lt;form:input path="primaryApplicant.email" type="text" class="form-control" placeholder="Primary Applicant Email" data-type="email"/&gt;&lt;br/&gt;
  &lt;/form:form&gt;
  </code></pre>
  
  <p><strong>rentalapp2 JSP:</strong></p>
  
  <pre><code>Date Created: &lt;c:out value="${rentalApplication.dateCreated}"&gt;&lt;/c:out&gt;&lt;br/&gt;  &lt;!--PRINTS DATE--&gt;
  Primary ID: &lt;c:out value="${rentalApplication.primaryApplicant.id}"&gt;&lt;/c:out&gt;&lt;br/&gt; &lt;!--PRINTS 0--&gt;
  Primary email: &lt;c:out value="${rentalApplication.primaryApplicant.email}"&gt;&lt;/c:out&gt;&lt;br/&gt; &lt;!--PRINTS EMPTY STRING EVEN IF SUPPLIED --&gt;
  </code></pre>
  
  <p>The SQL output using log4jdbc shows that the inserts are happening.  Perhaps the error is in the flow.xml?</p>