I've used a variation on Bruce's second method.  What I've done (and I'm
not claiming that this is particular nice) is:
1) When the user clicks the submit button, post the form (or whatever) to a
servlet as usual
2) That servlet clears a "finished?" variable from their session, e.g.
session.removeAttribute ("finished")
3) Servlet kicks off a new thread to do the guts of the processing that
will take some time
4) Servlet passes control onto the "please wait" JSP, e.g.
getServletContext ().getRequestDispatcher ("/JSP/PleaseWait.jsp").forward
(request, response);
5) The JSP is a regular looking "please wait" page, except that at the
bottom there's a section of Java code that checks the session variables to
see if the "finished" session variable has been set yet - if yes, it
outputs a redirect tag to send the user to the desired page.  If not it
outputs a garbage tag that does nothing (like </junk>), to stop the browser
from timing out, waits a 1/2 second and loops.
6) When the separate thread has finished, it sets the "finished" session

In this way as soon as the separate thread finishes, you're redirected from
the please wait page to show you the confirmation page.


Nigel Gay,
Computer Patent Annuities

> We used 2 ways for this type of confirmation.
> The first is also the easier way: as soon as user click submit button,
> show him a message say 'please wait ...' and disable the submit button.
> Then use AJAX to submit the processing request to server. AJAX returns a
> confirmation page that is then embedded/replaced in the same page. This
> approach requires some Javascript and css.
>  The second way. As soon as user click submit button, submit a
> processing job (new thread) and display a waiting page. This waiting
> page uses refresh tag to check the status of the processing on the
> server and stays in browser. When the processing is done  the thread
> servlet sends a confirmation page back.
> Bruce
> Mike Burdette wrote:
> >I have a bill payment web site which has a payment information form
> >(credit card number, expiration date, etc...) on a page which stays
> >displayed after the user clicks "Submit Payment". The confirmation page
> >not shown until the transaction has completed which may take as long as
> >10- seconds. I am having trouble with users clicking a second time and
> >submitting two payments.
> >
> >I am assuming that I could just redirect the browser to the "Please
> >wait...." page while the credit card processes the request, but how will

> >that page know that the credit card process is done and send the browser

> >to the confirmation page? I know that a lot of sites do this, but can't
> >figure out how it works. I am using Java servlet technology.
> >
> >TIA
> >
> >
> >Mike
> >
> >
> --
> This is the Java Programming on and around the iSeries / AS400
> (JAVA400-L) mailing list
> To post a message email: JAVA400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/java400-l
> or email: JAVA400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/java400-l.

The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee; access to this
email by anyone else is unauthorised.

If you are not the intended recipient: (1) you are kindly requested
to return a copy of this message to the sender indicating that you
have received it in error, and to destroy the received copy; and (2)
any disclosure or distribution of this message, as well as any action
taken or omitted to be taken in reliance on its content, is prohibited
and may be unlawful.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.