aspose file tools*
The moose likes Struts and the fly likes How to display a loading gif while transfering from one jsp page to another ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to display a loading gif while transfering from one jsp page to another ?" Watch "How to display a loading gif while transfering from one jsp page to another ?" New topic
Author

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

Sidhartha Ray
Greenhorn

Joined: Jul 04, 2012
Posts: 29
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

Joined: Nov 10, 2008
Posts: 12

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!

--
Sandeep
Sidhartha Ray
Greenhorn

Joined: Jul 04, 2012
Posts: 29
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

Joined: Nov 10, 2008
Posts: 12

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.

 
Don't get me started about those stupid light bulbs.
 
subject: How to display a loading gif while transfering from one jsp page to another ?