Hi,
You can do it using the following code in your Servlet.
=================================================================================
public void doGet ( HttpServletRequest req, HttpServletResponse res )
throws ServletException, IOException
{
res.setContentType( "text/html" );
HttpSession session = req.getSession( true );
PrintWriter out = res.getWriter();
if ( session.getValue( "waitPage" ) == null ) {
session.putValue( "waitPage", Boolean.TRUE );
out.println( "<html><head>" );
out.println( "<title>Please Wait...</title>" );
// The interesting part:
// <meta http-equiv="Refresh" content="0">
out.println( "<meta http-equiv=\"Refresh\" content=\"0\">" );
out.println( "</head><body>" );
out.println( "<br><br><br>" );
out.println( "<center><h1>Your records are being accessed.<br>" );
out.println( "Please wait.</h1></center>" );
out.close();
}
else {
session.removeValue( "waitPage" );
out.println( "<html><head><title>Example 6</title></head>" );
out.println( "<body>" );
out.println( "<h1>Countdown</h1>" );
for ( int i = 10; i > 0; i-- ) {
out.print( "<h1>" );
out.print( i );
out.println( "</h1>" );
try {
Thread.sleep( 1000 );
}
catch ( InterruptedException e ) {}
}
out.println( "<h1>Liftoff</h1>" );
out.println( "</body></html>" );
out.close();
}
}
=====================================================================
I picked up the above source code from an article on the JavaWorld site.
You too may visit :
http://www.javaworld.com/javaworld/jw-12-1998/jw-12-servlethtml_p.html
Thanks
-- Anoop
"G Ramesh [Support]" <[EMAIL PROTECTED]> on 05/02/2000 12:43:19 PM
Please respond to "A mailing list for discussion about Sun Microsystem's Java
Servlet API Technology." <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Anoop Maheshwari/HSS)
Subject: Display Temporary Page
Hi,
I want to display a temporary page like "please wait... server is
processing your request", when a client given their input in the html form
and submits it to the server.
could any one help me to provide an example for both SERVLET and JSP.
Thanks in advance.
----------------------------------------------------------------
Regards,
G Ramesh
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html