• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP page refresh

 
Trader Joey
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I ensure that a JSP page is displayed/refreshed only after the entire page has been evaluated. Here's whats happening:
1. The JSP evaluates code snippets and starts displaying them. Its displays an html form and a submit button.
2. Midway through the page is a backend query that takes a significant amount of time to evaluate.
3. The results of the backend query are evaluated and the page is displayed completely.
However, while step 2 is still executing.... if the user clicks on the submit button that was already displayed on the page, we get unanticipated results. Is it possible to instruct the JSP page with some HTML headers to wait for the complete page to be evaluated before the page is displayed.
Thanks for your help in advance.
Nikhil
 
jyothsna kumari
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai,
i think u can do either way.
1.u can disable the submit button till the query executes.once the execution is completed then enable the button so that u can prevent
the user to click
2.u can set a session variable after the completion of the process.on page load u can call a function which checks for the session variable.if it is not set then wait without loading and if set, then continue load the page.
hope this may help u
jyothsna
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you can perform the lengthy processing in a servlet before forwarding along to the JSP at all (a la Model 2).
And now, Nikhil Nikhil, with over 30 posts on the Ranch, you must be aware by now that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
Thanks!
bear
JSP Fourm Bartender
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic