Re: Display Updated/changed value(from cache) in JSP



Buddha wrote:
On Jan 30, 8:34 pm, "gwoodho...@xxxxxxxxx" <gwoodho...@xxxxxxxxx>
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 );
}
.



Relevant Pages

  • Re: Control flow design question
    ... As it turns out, I CAN use a different IP/Port for each socket, so I ... transmitted back to the appropriate channel terminals). ... and appends each request to its channel's queue. ... Each queue's requests are processed by one dedicated worker ...
    (comp.lang.java.programmer)
  • Re: NIO best practice
    ... public FileChannel fchannel; ... How can the request method ever be "GET" in those cases? ... You need to be much more defensive than this: use a buffer per channel and accumulate reads *until* you have a complete request. ...
    (comp.lang.java.programmer)
  • Re: LAT application port notification of events
    ... let the user do the interactive stuff and have a request to relock ... It's not a lock. ... The terminal driver has an attention AST from the ... means stop reading and deassign the channel. ...
    (comp.os.vms)
  • Re: GNAT.Sockets. Blocking?
    ... I'm kind of new to socket programming and I need some help here. ... header in the HTTP request. ... Channel: out GNAT.Sockets.Stream_Access; ... TODO: make a loop ...
    (comp.lang.ada)
  • Re: NTL
    ... Alan Gauton wrote: ... request started me on this thread, and he confirmed to me that his ... and as he is nearly 90, I expect that he finds it too daunting to trawl ... blue button until they find the channel they want. ...
    (uk.tech.digital-tv)