Robert,
just curious: why would you do a (MyObject)getProperty("foo") instead
of just defining a public abstract MyObject getFoo() ? Is it just to
save yourself from defining these abstract methods in your class?
Dario
On 7/20/05, Robert Zeigler <[EMAIL PROTECTED]> wrote:
> Incidentally, just to point out to new users...
> You don't /have/ to have an abstract accessor.
> You can define the property in the .page or .jwc file,
> and then access it using the "getProperty("foo")" method.
> (like: MyObject obj = (MyObject) getProperty("myObj");)
> There is a corresponding setProperty method, as well.
> If you like having getters/setters, but don't like the abstract methods,
> you can do something like:
> 1) Define property "prop_foo" in your .page/.jwc file
> 2) Define a concrete accessor in your .java file that look like:
> public Foo getFoo() {
> return (Foo) getProperty("prop_foo");
> }
> public void setFoo(Foo f) {
> setProperty("prop_foo",f);
> }
>
> Note that if you choose to do this, then the concrete property should be
> different than the property defined in your .page/.jwc file.
>
> Robert
>
> Howard Lewis Ship wrote:
> > You are not making your properties abstract; you are therefore having
> > problems because user data is stored in properties of pages (stored
> > within the page pool), not within the HttpSession as they should be.
> >
> > When the pages are culled from the page pool, you lose your server side
> > data.
> >
> > You MUST use abstract accessor methods and mark the properties as
> > persistent. Only in this way will properties be stored into the
> > HttpSession. This can be done in 3.0 using XML and in 4.0 using
> > annotations (or XML).
> >
> > The fact that your application works at all in development is a
> > feature. It will neither scale to more users on a single server, or
> > work in properly in a cluster.
> >
> > Not a single example piece of code in TiA or in the Quick Start
> > tutorial tries to do such an "end run" around Tapestry. Do so at your
> > own peril.
> >
> > The only times I don't use abstract properties is when I want to cache
> > an expensive object that is not client- or request- dependent. For
> > example, I may cache an IPropertySelection model, lazily creating it
> > as necessary.
> >
> >
> > On 7/18/05, Edward Scanzano <[EMAIL PROTECTED]> wrote:
> >
> >>Hi all,
> >>
> >>I have a situtation where my application runs normally
> >>as I click through it. Parameters are being passed to
> >>components correctly, etc. However, if I let the
> >>application sit idle for a short time (maybe 10
> >>minutes, not sure of the exact time) then when I click
> >>on those same links I get exceptions that are caused
> >>by component parameters being null. The session has
> >>not timed out yet.
> >>
> >>What is causing this?
> >>
> >>Thanks
> >>E
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>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]
>
>
--
Communism is man's exploitation of man. Capitalism is just the opposite.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]