• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Please wait message

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Consider AJAX yet? This seems to be a hot thing with the now numerous frameworks.

-Avinash
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Few months back, we had a similar discussion here
 
John Daniel
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Are you here to take over the surface world? Because this tiny ad will stop you!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic