jQuery in Action, 3rd edition
The moose likes Struts and the fly likes How to integrate progress bar between servlet and actionclass Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to integrate progress bar between servlet and actionclass" Watch "How to integrate progress bar between servlet and actionclass" New topic

How to integrate progress bar between servlet and actionclass

Mohit Mehta

Joined: Jan 24, 2005
Posts: 25
Hi All,
I have one problem..
I my project i have action class which do some heavy business logic and takes time to forward to next view (.jsp)
So for that i want to add progess bar in between can anybody suggeste me how can i show real time progress bar and same time i can continue running my action class business logic.

Thanx in advance for quick idea plz......

Regards,<br />BulletProof Monk.<br /> <br />"Nthing the Mind of man can Conceive<br />and Believe,It can achieve"
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

Real time? Nope. You'd need a SocketConnection for that and good ol' html over http doesn't support it.

You could fake it with a wait page (search the past threads for this topic) that keeps resending an "Are-we-there-yet?" kind of request to the Action. If the Action knows how far along it is in processing it could send a percentage number to be displayed on the next instance of the jsp wait page. That's a lot of extra network traffic though to send it back and forth so much.

A good workman is known by his tools.
Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
I have a similiar question.

I have a page that does a search of a database and returns the first 100 or so, is there a way to have it display the first 100 results but to keep getting the rest of the results and to "cache" them? So they're available after hitting something like "view next 100"?

rahul V kumar
Ranch Hand

Joined: May 20, 2003
Posts: 82
You can checkout this link


They implement progress bars. maybe you can get some idea from there.
JothiKumar Ekanath
Ranch Hand

Joined: Dec 21, 2003
Posts: 30
Is it a best approach to start a new thread from the action class where i do time consuming operation in that thread and return.By this time what should be done to the main thread that called the action class.

1.Wait 2.return to a status page,after creating child thread

I am just confused,will this work if the number of users are more
I agree. Here's the link: http://aspose.com/file-tools
subject: How to integrate progress bar between servlet and actionclass
It's not a secret anymore!