Problem:
    When I submit a form which persists a new object to the database and I
return back to the form to create a new object but the old object values are
still there. I'm using @InjectObject in my code and I'm not sure how to tell
the class to reset the value.

Artifacts:
[PAGE CLASS]
public abstract class AddPerson extends PersonPersistenceAbstract {
...
@InjectObject("spring:Person")
    public abstract Person getPerson();
...
    public void detach() {
        if (log.isDebugEnabled())
            log.debug("Page Detaching");
        super.detach();
    }
}

[PAGE SPECIFICATION]
<!DOCTYPE page-specification PUBLIC
  "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd";>
<page-specification class="
org.fightmaster.person.presentation.page.AddPerson">
  <inject property="listPerson" type="page" object="ListPerson"/>
  <component id="personForm" type="Form">
    <binding name="listener" value="listener:onSubmit"/>
  </component>
  <component id="firstname" type="TextField">
    <binding name="value" value="ognl:person.firstname"/>
  </component>
  <component id="middlename" type="TextField">
    <binding name="value" value="ognl:person.middlename"/>
  </component>
  <component id="lastname" type="TextField">
    <binding name="value" value="ognl:person.lastname"/>
  </component>
</page-specification>

[SPRING BEAN XML]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd";>
<beans>
  <bean id="Person.Hibernate.Annotation.SessionFactory" class="
org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    <property name="configurationClass" value="
org.hibernate.cfg.AnnotationConfiguration"/>
    <property name="configLocation" value="classpath:hibernate.cfg.xml"/>
  </bean>
  ...
  <bean id="Person" class="
org.fightmaster.person.business.hibernate.PersonImpl" singleton="false">
    ...
  </bean>
  ...
</beans>

Specs:
    Tapestry 4
    Hibernate 3
    Spring 1.1
    Java 1.5
    Tomcat 5.5

 Summary:
The setup works as far as persistence goes. My objects are persisted to the
database. My issue has to do with session and why I can't get my Person
object to reset for the next request. Thanks for any guidance.


Kevin

Reply via email to