Properties specified in your .page are indeed stored in the session, but
they are page-local.  So myProp on page A is different than myProp on
page B.  You could store myProp in your visit object so it is available
to all your pages or push the value from page A to page B (assuming you
navigate in that direction).  Something like (in A):

public IPage myListener(IRequestCycle cycle)
{
  B myB = (B) cycle.getPage("B");
  myB.setMyProp(getMyProp());
  return myB;
}

/dev/mrg

-----Original Message-----
From: Martin Carel [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 24, 2006 9:45 AM
To: Tapestry users
Subject: Persistence in session


Hi all!

I have this in my page A's spec:

<property name="myProp" persist="session"/>   

I want to retrieve this property (myProp is a String object) in page B.

I assumed that all was needed was to specify this in my page B's spec:
<property name="myProp" persist="session"/>   

and then retrieve the property's value as usual from my page B's HTML 
template:
<span jwcid="@Insert" value="ognl:myProp"/>

But it does not work. I got an empty string on page B where I should see

a string for this property's value.

If I create a parsing error in my page B's HTML template (a trick that I

use in order to get the Tapestry's exception page), I see that my 
session-persisted property "myProp" is indeed in the HttpSession with 
the correct value, set from page A, so I feel I'm really close to get 
what I want.

Any hints is appreciated.

/Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to