aspose file tools*
The moose likes Servlets and the fly likes Please wait message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Please wait message" Watch "Please wait message" New topic
Author

Please wait message

John Daniel
Greenhorn

Joined: Mar 27, 2005
Posts: 20
My servlet needs to send a message, via MQ, to another platform and wait for a response. This process may take several minutes. Is it possible to display to the user a pop-up message telling them that their request is being processed and to wait? And then when the request is finished, remove the pop-up, and display a completion message?

Thank you,
John Daniel
Avinash Ramana
Greenhorn

Joined: Jul 31, 2006
Posts: 11
Consider AJAX yet? This seems to be a hot thing with the now numerous frameworks.

-Avinash


J2EE programmer for JTG..
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9317
    
109

Few months back, we had a similar discussion here


[My Blog] [JavaRanch Journal]
John Daniel
Greenhorn

Joined: Mar 27, 2005
Posts: 20
Due to the ever shifting priorites from management, I haven't been able to work on this issue again until now. Anyway, this week I started working again on displaying a "please wait" message using Bear Bibeault's advise of a simply displaying a hidden message.

However, not being familiar with JavaScript, I had a hard time figuring out how to do that. So in case someone does a search on this topic, and wants to know how to display a "please wait" message, here's is how I got it to work.

In your JSP, add the following:
<script language="JavaScript">
function displayWait() {
var waitDiv = document.getElementById("wait");
waitDiv.style.display = "inline";
var msgDiv = document.getElementById("message");
msgDiv.style.display = "none";
return true;
}
John Daniel
Greenhorn

Joined: Mar 27, 2005
Posts: 20
Sorry, I submitted my response before I was ready.

Anyway, in my JSP, I added:

<script language="JavaScript">
function displayWait() {
var waitDiv = document.getElementById("wait");
waitDiv.style.display = "inline";
return true;
}
</script>
. . .
<form name="ResetPassword" action="../servlet/whatever"
method="post" onSubmit="return(displayWait());">
. . .
<div class="wait" id="wait">
Your request is being processed, please be patient.
</div>
. . .

And in my CSS file, I added:

div.wait {
width: 39%;
padding: 4px;
display: none;
margin-left: 40px;
color: green;
background-color: white;
}


So what the JavaScript code is doing is simply changing the default display attribute from "none" (don't display) to "inline" (do display).

Hopefully, someone will find this helpful.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please wait message
 
Similar Threads
Getting parameters from a pop-up window
please wait message using javascript
can a servlet response multiple times to single request
How to display a popup menu on right click in swing
How to displays pop up message when error occurs?