This sounds promising, and I am now on 4.1.1-SNAPSHOT...

public abstract ApplicationStateManager getASM();


As easy as declaring this in a BasePage subclass???


-Greg

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of James
Carman
Sent: Thursday, December 14, 2006 3:08 PM
To: Tapestry users
Subject: Re: Proper way to get ApplicationStateManager?


What version of Tapestry are you using?  4.1?  If so, then it can
autowire stuff for you out of the HiveMind registry.  Just declare an
abstract getter that returns an ApplicationStateManager.  If you're on
4.0, you can download the tapestry-autowire source and build it (via
SVN http://svn.javaforge.com/svn/tapestry/tapestry-autowire/trunk/,
username/password anonymous/anon).  Just drop it into your classpath
and it will do the same thing as 4.1.

On 12/14/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> I'm replacing the old getVisit() object.
>
> So most of my pages have a call to getVisit(), which returns my AdminVisit 
> object, which has the information about if they are logged in, what 
> permissions they have etc.
>
> Almost every page calls getVisit(), my Border also calls getVisit() to 
> determine if it's showing a simple "Login" link on the left, or if it's 
> showing a full menu because they are logged in.
>
> I'm close to wrapping up day 3 trying to get things working! So far the end 
> is not in sight.
>
> What I've been able to gather is that I *think* I need to store 
> ApplicationStateManager somewhere as a singleton, and then retrieve my visit 
> object or store it as needed from there.
>
> I've implemented this method (obviously doesn't work) in hopes that it will 
> work someday, I think the idea is correct?
>
>         protected AdminVisit getAdminVisit()
>           {
>            AdminVisit aVisit = (AdminVisit) 
> PCTAdminApplicationServlet.asm.get("adminVisit");
>
>            if (aVisit == null){
>              aVisit = new AdminVisit();
>
>            PCTAdminApplicationServlet.asm.store("adminVisit", aVisit);
>            }
>            return aVisit;
>           }
>
>
> Thanks,
> Greg
>
> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] Behalf Of Ron Piterman
> Sent: Thursday, December 14, 2006 2:23 PM
> To: users@tapestry.apache.org
> Subject: Re: Proper way to get ApplicationStateManager?
>
>
> Tell us when do you need it and why... *maybe* we can tell you how...
> Cheers,
> Ron
>
>
>
> [EMAIL PROTECTED] wrote:
> > Thanks Dennis - I'm not sure I understand how to go about fixing the 
> > problem if it's null at the times I need it :)
> >
> > Greg
> >
> >
> >
> >>
> > Greg,
> >
> > You can do what you described before, but pull your visit object in your
> > SomePage.java classes where you need it.  As Ron pointed out, ASM uses
> > other service where WebRequest is required.  When you're using it, it's
> > still null.
> >
> > -Dennis
> >
> >
> > ---------------------------------------------------------------------
> > 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]
> >
> >
>
>
> ---------------------------------------------------------------------
> 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]
>
>
>

---------------------------------------------------------------------
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