I want some random no displaying on the web page and storing it into the database . please guide me how i can implement the same tutorial in jsp for continuous value without refreshing
Asked
Active
Viewed 1,446 times
-1
-
1What do you mean by "continuous value without refreshing"? – Jon Skeet May 17 '11 at 17:21
-
2possible duplicate of [random number generator without doing refresh](http://stackoverflow.com/questions/6032170/random-number-generator-without-doing-refresh) – jmj May 17 '11 at 17:22
-
@Jon Skeet like the stated over http://jsfiddle.net/mattball/c9t3T/ – umar May 17 '11 at 17:25
-
1Start learning Ajax. You can find here some kickoff examples to build further on: http://stackoverflow.com/questions/4112686/update-current-page-with-a-servlet – BalusC May 17 '11 at 17:30
-
@umar: Okay, so that's periodically updating... I'm finding it hard to guess what you then want to store in the database... – Jon Skeet May 17 '11 at 17:32
-
My answer with that Q. already answers you. please re read it. – jmj May 17 '11 at 17:32
-
@Jon Skeet performing some test work on google app engine . creating some sensor type of data for it . – umar May 17 '11 at 17:34
-
@umar: That's still *way* too vague. You're showing lots of numbers. Which one do you want to store in the database? And where do sensors come into play? Please read http://tinyurl.com/so-hints – Jon Skeet May 17 '11 at 17:38
-
Possibly not accurate way but i have find this shortcut <%response.setIntHeader("Refresh",1); %> <%= (int) (Math.random() * 10) %> – umar May 17 '11 at 18:17
1 Answers
1
This guy should help: java.lang.Math random()

Mat
- 202,337
- 40
- 393
- 406

Peter Sankauskas
- 2,882
- 4
- 27
- 28
-
Thanks for your concern but it will only give random value for once . As i want to get same result as done in javascript http://jsfiddle.net/mattball/c9t3T/ ie values are constantly changing – umar May 17 '11 at 17:27