cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gentry, Michael \(Contractor\)" <michael_gen...@fanniemae.com>
Subject RE: Tapestry tutorial advice
Date Thu, 08 Jun 2006 19:29:53 GMT
Doing the <inject/> is fine for smaller applications (examples), but
isn't as nice when you have a lot of pages.  I tried making a
base/superclass page and putting the <inject/> in it, but that doesn't
inherit.  I have to admit I still don't fully understand the craze over
injection/etc.  I have no problems with asking my framework for the
session and it providing it to me using subclassing.  The solution I
came up with is much more convoluted.

/dev/mrg


-----Original Message-----
From: Eric Schneider [mailto:eric.j.schneider@gmail.com] 
Sent: Thursday, June 08, 2006 2:28 PM
To: cayenne-user@incubator.apache.org
Subject: Re: Tapestry tutorial advice


Andrus,

We're still using 1.4, so this is how we do it.

Create a class, like Session.java (with a DataContext instance
variable).   In the <appname>.application file you add the following
line:

<meta key="org.apache.tapestry.visit-class"
value="com.nhl.cmseditor.Session"/>

In MyPage.java

public abstract Object getSession();

In MyPage.page

<inject property="session" type="state" object="visit"/>

I think that's it.

e.



On 6/8/06, Andrus Adamchik <andrus@objectstyle.org> wrote:
> I am reworking Cayenne tutorials for 1.2 final release. Since I
> haven't used Tapestry for almost a year, and totally missed on 4.0, I
> wanted to get some feedback from Cayenne/Tapestry users. What are the
> good ways to bind DataContext to a session?
>
> Current example puts it in the visit. I would personally use a
> regular web app setup with Cayenne filter (making Tapestry app just
> another web app case as far as Cayenne is concerned). I wonder what
> others are doing in this respect? Any HiveMind magic?
>
> Andrus
>

Mime
View raw message