• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display a loading gif while transfering from one jsp page to another ?

 
Sidhartha Ray
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
A jsp page(say send-mail.jsp) is there, which receives mail id & password(from), sends mails to multiple recipients(say 20 persons) whose ids are retrieved from an excel sheet & forwards to the home page(say, home.jsp). Problem is that, while sending mails, control remains at the same page(i.e., send-mail.jsp) means that page is displayed on browser untill all the mails are sent, and after that it forwards to the home page.

But, I want to display a .gif file at that mean time.........

Any suggestion ???
 
Sandeep Gabhale
Greenhorn
Posts: 12
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sidhartha,

You can give Ajax call to send-mail.jsp from the current JSP page by giving a hyperlink or button like "Send Mail".
Provide and empty div tag in the current JSP page and once clicked on the link/button (Send Mail) fill the div with loading.gif image and the image will be displayed till all the mails been sent.
Once all the mails been sent then display the message "Mail sent successfully" and give a link for home page.

As I've used this kind of loading.gif for Ajax call and most developers use Ajax call and show up loading till the request is processing.

Hope this will help you!
 
Sidhartha Ray
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sandeep,
Is there any way of displaying the .gif along with the page from which request is to go, as a background page, but in not active mode, means the .gif will be displayed but we cant't interact with the background page.
 
Sandeep Gabhale
Greenhorn
Posts: 12
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sidhartha,

Pop-up a light-box on the call of send-mail.jsp.
Keep the .gif image on the light-box till all the mails sent. With this it gives a feeling of processing mails and at the same-time the previous page will be in-active as required.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic