Creating automatic updating web pages
-
Hi All! My company has a requirement, wherein we need to develop a web server which could server data to its clients in "real-time". For example, I need to create a web page for real time stock quotes, which is automatically updated as and when the quotes change. Can the server be designed such that it sends automatic updates to the client as and when the data changes, or does the client have to make an explicit "refresh"? Since I am new to web development, could you please guide me about which tools/technologies can I best use for this purpose. Thanks, Krishnan
-
Hi All! My company has a requirement, wherein we need to develop a web server which could server data to its clients in "real-time". For example, I need to create a web page for real time stock quotes, which is automatically updated as and when the quotes change. Can the server be designed such that it sends automatic updates to the client as and when the data changes, or does the client have to make an explicit "refresh"? Since I am new to web development, could you please guide me about which tools/technologies can I best use for this purpose. Thanks, Krishnan
The server does not keep track of the user that makes the request. Since HTTP is stateless (make the request, get data back), it's nearly imposible to do it. The client will have to 'refresh' itself on an interval basis to pull back the latest data. If the client is a web browser, you could implement some JavaScript that posts back to the server every couple seconds. ~Javier Lozano (blog)
-
The server does not keep track of the user that makes the request. Since HTTP is stateless (make the request, get data back), it's nearly imposible to do it. The client will have to 'refresh' itself on an interval basis to pull back the latest data. If the client is a web browser, you could implement some JavaScript that posts back to the server every couple seconds. ~Javier Lozano (blog)
Your other option could be to implement the attritbute in your HTML page. THis will however cause the page to automatically refresh on the server every 5 seconds. Vivek Sharma
-
Hi All! My company has a requirement, wherein we need to develop a web server which could server data to its clients in "real-time". For example, I need to create a web page for real time stock quotes, which is automatically updated as and when the quotes change. Can the server be designed such that it sends automatic updates to the client as and when the data changes, or does the client have to make an explicit "refresh"? Since I am new to web development, could you please guide me about which tools/technologies can I best use for this purpose. Thanks, Krishnan
The problem with doing it throught a web page, as the other responses have mentioned, is that a web server does not constantly talk back and forth with the client. It only offers the info once. A better way to do what you want to do is via a java app. You could have a client app embedded in a web page so that your customers could still use their browser, but then you would have another server app on your side which stays connected to the client java app, constantly offering the latest data.
-
The problem with doing it throught a web page, as the other responses have mentioned, is that a web server does not constantly talk back and forth with the client. It only offers the info once. A better way to do what you want to do is via a java app. You could have a client app embedded in a web page so that your customers could still use their browser, but then you would have another server app on your side which stays connected to the client java app, constantly offering the latest data.
Thanks for the suggestions. But, having an embedded Java app or an ActiveX requires that my customers have them pre-installed or that they are automatically downloaded and installed on his computer. Even though I would not prefer such a method, I am still open to it, as I feel it is better than the client doing a periodic refresh. However, will this solution work for browsers running on embedded platforms like, mobile phones, PDAs, etc.? Thanks, Krishnan
-
Thanks for the suggestions. But, having an embedded Java app or an ActiveX requires that my customers have them pre-installed or that they are automatically downloaded and installed on his computer. Even though I would not prefer such a method, I am still open to it, as I feel it is better than the client doing a periodic refresh. However, will this solution work for browsers running on embedded platforms like, mobile phones, PDAs, etc.? Thanks, Krishnan
Why don't you use iframes. when user complete the action on that event pass the parameter to iframe which call the another page and on that page you can write the code of save. it will refresh only iframe not the whole page. with the help of iframe you can do easly update and client page cannot be refresh only iframe will refresh for that particular task of saving first make a page and onload of this page write the code for saving perticular data to database and the saving code will be the parameter that u pass to tha iframe which call the page of saving. and in iframe just give source of that page with passing parameter. that time only iframe will refresh and your saving page do the task of saving and client can do his work without whole page loading. If u understand this then ok or mail me i will send u whole code of iframe how they work and how they usefull when u dont want to load or refresh whole page. (Hemant U. Mane)