to instantiate your object implement the PageBeginRenderListener interface and invoke the abstract method that returns the ASO (Person) and it will be created :)
g, kris ps.: i think there was some talk about eager loading ASOs some weeks or month ago.... i'm not sure Kristian Marinkovic <[EMAIL PROTECTED]> 12.04.2007 15:35 Bitte antworten an "Tapestry users" <[EMAIL PROTECTED]> An "Tapestry users" <[EMAIL PROTECTED]> Kopie Thema Antwort: Re: help injecting tate objects hi andrea, not exactly... the Person object (ASO) is persisted in the session when it is accessed the first time... if there is no session, it will create a new one :) g, kris "Andrea Chiumenti" <[EMAIL PROTECTED]> 12.04.2007 15:27 Bitte antworten an "Tapestry users" <[EMAIL PROTECTED]> An "Tapestry users" <[EMAIL PROTECTED]> Kopie Thema Re: help injecting tate objects Thx Kristian, but I'm using jdk 1.4 so I can't use InjectStateFlag, so isn't possible to initiate the object via configuration file ? doesn't <state-object name="wizardPerson" scope="session"> <create-instance class="org.jfly.demo.edittable.vo.Person" /> </state-object> create an instance of Person when Session is first created ? On 4/12/07, Kristian Marinkovic <[EMAIL PROTECTED]> wrote: > > hi, > > this happens because you access the Person object before > it is instantiated. the easiest thing is to add a if before your > input to check whether the object is null > > in tapestry 4.1 theres is the InjectStateFlag annotation > that returns true if your ASO is instantiated > > or you can instantiate your Person object during the init phase > of your page by accessing it once > > g, > kris > > > > > "Andrea Chiumenti" <[EMAIL PROTECTED]> > 12.04.2007 15:01 > Bitte antworten an > "Tapestry users" <[EMAIL PROTECTED]> > > > An > "Tapestry users" <[EMAIL PROTECTED]> > Kopie > > Thema > help injecting tate objects > > > > > > > hello I've the following problem: > > hivemodule.xml > ............. > <contribution configuration-id="tapestry.state.ApplicationObjects"> > > <state-object name="wizardPerson" scope="session"> > <create-instance class="org.jfly.demo.edittable.vo.Person" /> > </state-object> > </contribution> > ........ > > > page template: > ....... > <inject property="person" type="state" object="wizardPerson"/> > ....... > > html template: > ..... > <input jwcid="@Insert" value="ognl:person.name"/> > ..... > > > > The exception thrown when I access the page is: > > log > ognl.OgnlException: person [java.lang.IllegalStateException: Cannot create > a > session after the response has been committed] > at ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:1046) > at ognl.ObjectPropertyAccessor.getPossibleProperty( > ObjectPropertyAccessor.java:60) > at ognl.ObjectPropertyAccessor.getProperty( > ObjectPropertyAccessor.java:134) > .................. > > > page: > Unable to parse OGNL expression 'person.name': Error compiling expression > on > object [EMAIL PROTECTED] with expression node person.name getter > body: null setter body: null > > > How can I solve this ? > >