Gourbich Bogdan wrote:
> I am new to Tapestry,
>
>
Welcome to component web application development!
> please , explain and draw an analogy :
>
> In JSP , we store "user objects" in the HTTPSession ,
> and "application level objects" , for example , cache ,
> in the ServletContext.
> In Tapestry , we store "user objects" in the "Visit Object",
> and "application level objects" in the "Application Engine"
> am I right ?
>
>
You are correct in your explanation of JSP storage scopes. However, in
Tapestry you don't have to be so coarse-grained. JSP has too few
scopes in which to store your state. You get:
* request - very temporary, lasts only as long as the current request
* page - also temporary, lasts only as long as the page is running
* session - lasts while the current user is navigating
* servletContext - lasts throughout the life of the application
All well and good but inevitably you have to figure out how to store
these things hierarchically so that you can get back to values and
associate them with individual parts of the page - usually some
complicated name mangling scheme or somesuch.
In Tapestry you normally won't be storing stuff directly in any of these
scopes because the "parts" of the page - the components - store the
state of the visit and they are organized for you and are already in the
"correct" hiearachy. When a component is called as part of the
request/action/response cycle it modifies it's internal variables based
on it's internal logic (this could get parameters from the request
during the request phase, some computation during action, etc.). By the
time the response phase comes about the component just outputs the
contents of it's internal state through the template.
Effectively by storing variables in components you are storing them in
the Session because that's where the history of vists is kept. Anyone
who knows better please correct me on this one because I'm not yet
totally familiar with Tapestry yet (but I'm familiar with WebObjects
from which the idea springs).
- Drew
--
+---------------------------------+
< Drew Davidson | OGNL Technology >
+---------------------------------+
| Email: [EMAIL PROTECTED] /
| Web: http://www.ognl.org /
| Vox: (520) 531-1966 <
| Fax: (520) 531-1965 \
| Mobile: (520) 405-2967 \
+---------------------------------+
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer