This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I would like to show real time data on a web page means as soon as it processed by the model the request.setAttribute("abc", object); will set the attribute and it will immediately be take away by the getAttribute methord in jsp. I require this form of information flow but i dont know how to achieve it , would some one shed light as to how we can do that.
it might be acheived through ajax as this technology is used to update the webpage without refreshing the page and all the communication is in the background. but I dont know how to use ajax.
I am using servlets, jsp and tomcat and doing it in MVC architecture.
It will be easy if some one from coderanch throw some light in this regard.
what I am doing overall is simple:
model ----->(processing data) ----servlets (setting the data) ------>jsp (view it). so I just want to show in the view that is jsp as the data is processed by the model. and right now what happens is every thing is working fine but when i hit the submit button on the html page, browser window hangs until all the processing is done by the models (while loop) and when it ends, it shows all the data on the webpage.
zishan khan wrote:cannot achieve the real time data!!. bear, if that is right than how can twitter and fb sends the real time tweets and messages. i mean there must be some technology out there?
They don't send real-time information. If you try sending a tweet or a Facebook message, you'll see there is a fraction of a second required to do that. That isn't "real-time". And you can achieve sub-second response time too if you program accordingly. Just don't throw around technical terms like "real-time" unless you know what they mean.
as mentioned in all above posts, i agree, getting real time data is difficult.
but you can try Session and Request Event Listeners that are available. Try if they can be put to use in effective way to solve your problem