----- Original Message -----
From: "Christian Sell" <[EMAIL PROTECTED]>
To: "Dave Roberts" <[EMAIL PROTECTED]>
Cc: "Dirk Olmes" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Sunday, December 15, 2002 7:44 AM
Subject: Re: [Tapestry-developer] Stale session


> Dirk, Dave, and all,
>
> I arrived there yesterday myself by scanning the docs for the term
> "session". I was rather amazed that the link imposed the "stateful"
> default - in my case that just dont make sense. Now I am using
>
> <field-binding name="stateful" field-name="Boolean.FALSE/>

The new syntax for that is

<binding name="stateful" value="false"/>

or

<binding name="stateful" value="@java.lang.Boolean@FALSE"/>

>
> and all is well. BTW, Dave, I am using Spindle, but still prefer editing
> the XML files directly. So I cant blame Spindle.
>
>
> Heres my take on the different types of bindings:
>
> - "binding" could also be called expression-binding. It gets the value
> by dynamically evaluating an OGNL expression at runtime.

The vast majority of bindings are expression bindings, so keeping the name
short makes sense to me (especially if Spindle is hiding the XML).


>
> - "static-binding" gets the value from the body of the element (and not
> from a value attribute - why, I dont know). The value is taken as a
String.

This makes long bindings easier to read in the XML and, again, no difference
when using Spindle since you don't see the XML.

>
> -"field-binding" gets the value by accessing some static (heres where
> the confusion comes in) field. Why this is not the same as an expression
> binding is beyond me. Does the expression syntax not allow accessing
> static fields??

Since Tapestry integrated in OGNL, the need for field-binding has evaporated
and it will go away in a future release.

>
> So, if you used <static-binding/>, the "false" you supplied was taken as
> the String "false".

What happens is that a non-null value for the <static-binding> is
interpreted as true, even if the string is "false".

>
> I think, the names are quite confusing. Suggestions:
>
> - drop field-binding and extend expression syntax to allow accessing
> static fields.
> - rename static-binding to value-binding

The framework is big enough, and the number of existing apps out there large
enough, that we can't turn the framework on a dime.  It takes a couple of
releases to flush bad names out.  In many cases, names and concepts that
made perfect sense at the time are just a bit awkward now.

In general, you should only be using <binding> in your specifications (and
perhaps <inherited-binding> when building components, and <string-binding>
when you want static strings to be localized).  Use informal attributes in
your HTML template instead of <static-binding>.

A lot of the power of Tapestry is now coming from the OGNL library, so its
worth checking it out more carefully:  http://www.ognl.org



>
> Christian
>
>
>
> Dave Roberts wrote:
> > Dirk, thanks! This finally helped. I had been trying to set the stateful
> > parameter, but I finally figured out I was using a static-binding rather
> > than a dynamic binding. I figured since "false" was a constant, I should
> > use a static binding in that case, but I guess not. The posting you
> > directed me to caused me to look at the direct XML that Spindle produces
> > and I noticed the difference. As soon as I set things correctly, things
> > worked fine. Doh!
> >
> > So this then raises another question: What are the differences between
> > all the various binding types that Tapestry/Spindle supports? Should I
> > just be using dynamic bindings everywhere? I think I got throw off by
> > Spindle's choices and my equating constants to "static." Had I been
> > editing the XML directly, I probably would have just used "binding" and
> > it would have worked fine. Spindle presented me with a bunch of choices
> > and so I picked the one that seemed the most obvious. Should I just be
> > using dynamic bindings every time? If not, why, when, and where would I
> > use the other types? Previously, I had thought that "dynamic" was just
> > used for OGNL expressions accessing beans. Should it be used for
> > anything Java-like (I mean, OGNL != Java, so I didn't expect that
> > "false" would be valid syntax for that).
> >
> > In any case, I read on the Wiki that somebody is rewriting the tutorial.
> > Some treatment of this issue would probably make sense, particularly for
> > people using Spindle rather than editing the XML raw. (BTW, this is not
> > a slam on Spindle; it's a fine tool that really helps out.)
> >
> > -- Dave
> >
> >     ----- Original Message -----
> >     *From:* Dirk Olmes <mailto:[EMAIL PROTECTED]>
> >     *To:* Dave Roberts <mailto:[EMAIL PROTECTED]>
> >     *Cc:* [EMAIL PROTECTED]
> >     <mailto:[EMAIL PROTECTED]>
> >     *Sent:* Saturday, December 14, 2002 6:45 PM
> >     *Subject:* Re: [Tapestry-developer] Stale session
> >
> >         I'm using Tapestry 2.2 with Eclipse, Spindle 1.1.3, the Jetty
> >         version packaged with Tapestry 2.2. I have written a quick
> >         little Main class that sets up Jetty and gets things going. I
> >         have Tapestry working enough to create a few pages, use
> >         PageLinks, a Form, etc. It's just DirectLink that I have
> >         problems with right now.
> >
> >         Can somebody explain how, exactly, Tapestry as a framework
> >         decides the session is stale? I even looked at the source in the
> >         DirectService class and didn't see anything there that looked
> >         like it even checked or threw an exception related to a stale
> >         session.
> >
> >
> >     Hmm, did you try to make the link not stateful? See
> >     http://sourceforge.net/mailarchive/message.php?msg_id=2214563
> >
> >     HTH,
> >
> >     -dirk
> >
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> With Great Power, Comes Great Responsibility
> Learn to use your power at OSDN's High Performance Computing Channel
> http://hpc.devchannel.org/
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer
>



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to