Re: Display Updated/changed value(from cache) in JSP
Buddha wrote:
On Jan 30, 8:34 pm, "gwoodho...@gmail.com" <gwoodho...@gmail.com>
wrote:
There is a timer running.
I'm not sure if you have tried this but;
Why not create a javascript timer, one that sends a request to a
servlet every few seconds/minutes (depending on your capacity/server
load). In this way the response could give the value of the field you
need.
Ive done something similar in the past, but at a previous company so i
can't copy paste code im afraid. I managed it with the references at
w3schools. Great site that.
Hope that helps,
Graeme
Hi,
thanks for your replies.
make periodic requests to the server (via AJAX is
Well, thats the point. Assume 5 browsers have established a session
with the web server.
now 1 of them has bid his amount, whcih is, changed the current price
value. THIS, can be posted to the server.Also can be done using AJAX.
However, I would also want to update the rest of the 4 browsers with
the latest update of the price.
Right. Did you have a question there? Why wouldn't Graeme's suggestion work
for you?
The basic pattern for a resource manager (your server manages the resource of
common knowledge) is to have it answer only, and let the resource consumers be
request only.
The resource manager "holds" the request until it has an answer. So on the
"status" channel all /n/ clients request session status, but do not get an
answer right away. When one of the clients makes a change (a new bid), it
pushes the change on the "change" channel. The server then answers all /n/
requests for status with the new data over their respective "status" request
channels. When the clients receive their status data, they immediately make a
new request for the next status over their respective "status" channels.
Continue until shampoo bottle is empty.
--
Lew
public void washHair( ShampooBottle bottle ) throws EmptyBottleException
{
do { wash(); rinse(); } while ( repeat );
}