File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSP page refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP page refresh" Watch "JSP page refresh" New topic

JSP page refresh

Trader Joey
Ranch Hand

Joined: May 11, 2000
Posts: 33
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.
jyothsna kumari
Ranch Hand

Joined: Jul 21, 2003
Posts: 108
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
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63839

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.
JSP Fourm Bartender

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: JSP page refresh
It's not a secret anymore!