On 6 juil, 21:46, ytrewqsm <[email protected]> wrote:
> Thx brett....
>
> So stateless mean no usgae of servlet http session ?

Yes (or any other mechanism that stores values on the server-side
depending on a value given to a client and sent back in the requests).

Stateless means that the server state is entirely contained into the
resources and requests/response; in a word, a given request on a given
resource (URL) doesn't depend on a previous request having been done
before.

Imagine an document management webapp. It can be stateful if you store
the "current folder" on the server-side and use requests (probably
HTTP POST) similar to "cd subfolder", "cd ..", etc. to navigate int
the folder hierarchy. Or it can be stateless if you have an URL per
folder and use links to the other "folder URLs".
To create a new subfolder, in the stateful impl, you'd send an "mkdir
subfolder" and it would use the "current folder" to know where to
create the new folder; while in the stateless impl, you'd rather send
a request to the URL representing the "parent folder" to say "create a
folder named 'subfolder' as a child as *this* folder".

> Since assume the following scenario :
>
> A user does some query that is based on some query paramter he has.
> Then the result is dispalyed in pages on client side. in 100 / page.
> (but the results are huge 10000)
> On server side there has to be a cache or soemthing that "remember"
> the results of that query to display the next 200 and so on
> So a the server still has a state no ?

Not necessarily (in the "REST" sense): the server would store the
results "somewhere" with a bunch of URLs corresponding to the result
pages. If another user makes the very same request, the server might
be able to reuse the same resultset. To save resources, the server
would probably "expire" and drop the resultset. That doesn't mean the
server is stateful.

In "REST" parlance, the server is creating temporary *resources*; the
resources have their own state, but the server has no state by itself.

> Do i miss somenthign ?
>
> Or each time the server will execute a queryu to get first 100 then
> next 100 and so on ?

It is a possibility too; it depends on what is the most efficient:
making such "page" requests or storing results in a temporary resource
(could be hundreds of pages, where most of them won't ever be used in
the end).

You should really read about REST; it will answer most of your
questions about stateless vs. stateful.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to