|
Helping ordinary people create extraordinary websites! |
Get Dynamic Web Content with HTTPRequestBy Doug Davis2005-04-11
In Conclusion In my opinion, those couple of lines of code have really expanded the available options. For example, one of the projects I've played with (and hope to make available on alphaWorks or developerWorks) uses this technique to allow multiple people to simultaneously view and edit data on a Web page. Users see updates on their browsers immediately without having to refresh and without any annoying flickering, loss of scrolling position, or loss of unsaved data. I want to point out one important thing, if it wasn't already obvious, and that is -- this all happens through polling. This means that the browser must request updated data be sent, which is the one downside in comparison to applets. In the applet-based solution, the server can push data out to the browsers whenever it needs to. By using the HttpRequest object, you only get updates upon request so you want to time the polling for new data accordingly; network traffic might be too high otherwise. Of course, you also want to consider not requesting all data, but just changed data each time. Then if nothing has changed, no data is returned -- again, increasing performance. Perhaps it's just me, or I've been living under a rock, but I haven't seen this feature widely used or advertised. I hope you find it as useful as I have. Tutorial Pages: » A refreshing approach to page refreshes » Are applets healthy? » Along came the HttpRequest object » In Conclusion » Resources First published by IBM DeveloperWorks |
|