Hi i am trying to fetch Latest Data from Databases in a continous manner for a particular time interval , i am getting but data not display in front page in a continous way it only display old data what shoud i do , I am using javascript ,core java with Oracle Database
if you are not using ajax then I believe that you are using simple javscript code to generate the event to call requesting Page. Please check that how you are storing the result set data and getting data on jsp.
You can utilize collections classes to store result data pass it in the request on jsp page.
if you are doing same. post sample of code you are implementing.
Hi Krutik
I am using javascript setTimeInterval method and calling java method got the value but its continuosly not display value only it display value while it is loading the page , if you have Ajax sample or code which continuosly checking Database and display data then help me
It would be useful if we had some idea of how you were calling a Java method from your Javascript code. Right now we have essentially no information about what you are doing, so making suggestions about what you should be doing is clearly impossible. So show us how you are doing that.
Ah, I see. You are making a common mistake, namely you think that the HTML scriptlet is repeatedly evaluated in the browser. That isn't the case -- your JSP runs on the server and generates HTML (including Javascript) which is interpreted by the browser. If you use the "Display Source" feature in your browser you'll see that this is the case.
And yes, to do what you want to do you are going to have to use Ajax. However asking for random fragments of Ajax to be posted isn't going to be very useful, you're going to have to spend some time learning about it. Snippets aren't the way to go.
yes, ajax is the way in your case. you ask the sample code. however, It will be better, you get basic idea and learn ajax first rather asking direct help.