Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Servlet processing progress feedback

Status
Not open for further replies.

Swamphen

Programmer
Jul 17, 2001
84
0
0
IT
Dear Tek-tippers,

I'm still very ignorant when it comes to client-server Java programming. So forgive me if I'm asking basic questions.

What is the short-term goal? Upload rather large XML files to the Tomcat server, parse them using JDOM, convert the XML elements to Java objects and write these objects to a MySQL database.

For now I just managed to upload the XML files to the server, to parse them and -for testing purposes- to write them back to a server-side XML file. This already takes rougly 20 seconds of time (and now everything is even locally installed).

So I guess I need some sort of feedback mechanism from the server to the client. But I have no clue of how to implement this. Can anybody put me on the right track?

Thanks,
Gert
 
Well, I implemented something like that once by having the servlet, after completing the first step, load a jsp that displayed the progress so far.

The jsp had an OnLoad javascript method that immediately passed control back to the servlet to perform the next step. They kept bouncing back and forth until the entire sequence of steps was done.

The servlet stored information like step number, total numbe r of steps etc. in the session, and the jsp used that info to build a progress bar. My sequence had 11 steps, so the progress bar moved 11 times during the course of the processing.
 
Thanks for the tip. For now, I'm still trying to make the tool into a Java application, so the JSP approach won't work for me. But I guess I indeed can do something similar.

It (only) now occurs to me that probably most progress bars work the way you described (stepwise increase of progress instead of continuous increase of progress).

Greetings,
Gert
 
Wasn't there a JProgressBar class in Swing?

Cheers,

Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top