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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Progress Bar" Watch "Servlet Progress Bar" New topic
Author

Servlet Progress Bar

suraj sheikh
Greenhorn

Joined: Mar 07, 2008
Posts: 23
Hi,

Here's what i want.
I have a web page with a form, and i use a submit button to submit the data to a servlet.
While the servlet performs operation on the data, I want a gif animation to be shown to user.

I have a web page with the gif animation, so on submit i want 3 things to happen.

1. submit the data to servlet (post method)
2. open the "loading.html" page
3. once the servlet completes redirect to the results page.

Thank you
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

That can only happen if you employ Ajax for the POST. Otherwise, the browser will not perform any animation while the servlet is processing.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
suraj sheikh
Greenhorn

Joined: Mar 07, 2008
Posts: 23
Thats getting complicated.

How do i use AJAX ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

Ajax

I think this article is a good start.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

Another approach -- perhaps even more complicated -- is to perform the processing in a separate thread so that the response can return immediately. The user can come back later to check on progress.
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Bear Bibeault wrote:Another approach -- perhaps even more complicated -- is to perform the processing in a separate thread so that the response can return immediately. The user can come back later to check on progress.


I am also trying to achieve similar goal. Can you please refer to any example or docs?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

Look for the "long running process" example here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Progress Bar
 
Similar Threads
animating a gif
Progress GIF Just Displays but No Animation
Image while loading a page
problem with animation
How to put loading... when page is loading?