FYI...
There is a neat way to display a "Please wait...processing request" message while the user waits for the system. It's really straightforward and only takes a few lines of code.
Place your form inside of <div></div> tags
Place the code for the "Please wait..." message inside of <div></div> tags
When the jsp is loaded, the tags are defined so that only the code inside the first div tags is displayed - user only sees the form
When the submit button is clicked, a javascript function is called.
The javascript hides the code inside the first div tag (form goes away) and displays the code in the second div tag - "Please wait..." message is displayed
Then the javascript calls submitForm() so that the servlet is called and processing begins
When the servlet is done, he forwards the client to another jsp (Change Verification, Thank You, whatever) and the "Please wait..." message is replaced.
The "Please wait..." message will appear instantly
Lets the customer know that the system is doing something
Since the form is hidden, user cannot hit the submit button twice
There are lots of possibilities with hiding/displaying code.
It can be used on button click, hyperlink click, etc.
Sample jsp:
<html>
<head>
<title>Company Profile</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="shared/estyles.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id="formDiv">
<form action="submitCompanyProfileServlet" method="POST" name="COMPANY">
<!-- YOUR FORM GOES HERE -->
</form>
</div>
<div id="pleaseWaitDiv" style="display: none;">
<jsp:include page="pleaseWait.jsp"/>
</div>
<script type="text/javascript">
function submitForm(oForm)
{
// Hide the code in first div tag
document.getElementById('formDiv').style.display = 'none';
// Display code in second div tag
document.getElementById('pleaseWaitDiv').style.display = 'block';
oForm.submit();
}
</script>
</body>
</html>