You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Schulte Marcus <ma...@bmw.ch> on 2006/01/27 17:13:22 UTC

How should @Persist + @InitialValue behave?

I've just found, to my surprise, that a property annotated with 
@Persist + @InitialValue("someMethod()") in T4 get's re-initialised on every
request. Is this the expected behaviour? Are those annotations not meant to
be used together (the docs indicate that they _can_ be used together)? I was
somehow thinking that the initialvalue would be set only on blank (null)
props.
Or am I simply ready for the weekend ;) ?
somewhat stymied,
Marcus

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How should @Persist + @InitialValue behave?

Posted by Jesse Kuhnert <jk...@gmail.com>.
P.S. If any of this is related to your kickstart project, I may be of
service in helping you define some component enhancement contribution points
in tapestrys bytecode enhancement chain (using javassist).

That way you can provide a lot of functionality that is more or less hidden,
or not a required class extension/interface for users. Of course if it
doesn't have anything to do with that then just ignore everything I said ;)

On 1/27/06, Howard Lewis Ship <hl...@gmail.com> wrote:
>
> Yes, this is the explicit, documented, behavior for @InitialValue.
>
> If you want to use a simpler value, you can set the properties initial
> value to a constant inside finishLoad().  In that case, the value you
> provide is retained and re-applied at the end of the request.  With
> @InitialValue, the binding expression is re-evaluated and applied at
> the end of the request.
>
> On 1/27/06, Schulte Marcus <ma...@bmw.ch> wrote:
> > I've just found, to my surprise, that a property annotated with
> > @Persist + @InitialValue("someMethod()") in T4 get's re-initialised on
> every
> > request. Is this the expected behaviour? Are those annotations not meant
> to
> > be used together (the docs indicate that they _can_ be used together)? I
> was
> > somehow thinking that the initialvalue would be set only on blank (null)
> > props.
> > Or am I simply ready for the weekend ;) ?
> > somewhat stymied,
> > Marcus
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
>
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Jakarta Tapestry
> Creator, Jakarta HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: How should @Persist + @InitialValue behave?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Yes, this is the explicit, documented, behavior for @InitialValue.

If you want to use a simpler value, you can set the properties initial
value to a constant inside finishLoad().  In that case, the value you
provide is retained and re-applied at the end of the request.  With
@InitialValue, the binding expression is re-evaluated and applied at
the end of the request.

On 1/27/06, Schulte Marcus <ma...@bmw.ch> wrote:
> I've just found, to my surprise, that a property annotated with
> @Persist + @InitialValue("someMethod()") in T4 get's re-initialised on every
> request. Is this the expected behaviour? Are those annotations not meant to
> be used together (the docs indicate that they _can_ be used together)? I was
> somehow thinking that the initialvalue would be set only on blank (null)
> props.
> Or am I simply ready for the weekend ;) ?
> somewhat stymied,
> Marcus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>


--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org