Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display appliaction processing status msg in JSP

 
Gerome Kawa
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a JSP page with a button which when clicked does enormous processing at the back-end and takes around 10 minutes to complete. I want to provide the users some status update messages of what happening in the JSP.
Can anyone point to some sample application/design/code samples ideas of how to go ahead ?

Thanks
Kawa
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
10 minutes is way too long for a synchronous operation. The browser is likely to time out long before that.

Best to perform such long operations as background threads or in a separate daemon and give the users a means to monitor the progress of the operation.
 
Gerome Kawa
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually it is an existing application and I cannot change the existing mechanism. What I need is to some way display display some user friendly message which refreshes intermittently about the processing which is happening at the backend. The backend processing happens in three stages and I want to display the user different messages as each stage starts.
Please let me know if you have any idea.

Thanks
Kawa
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard way to do this is to kick off the long running process in another thread or process and return immediately to a polling status page.

The long running process can write to a database field, a file, or a scoped variable with the status of it's progress.
The polling page refreshes every n seconds, checking the progress (where ever the long running process writes it) with each iteration.
[ April 13, 2005: Message edited by: Ben Souther ]
 
Gerome Kawa
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben
Can you please tell me some URLs where I can find som sample code/workign application for such a mechanism. I am not that great in coding so need some help to start writing it and then I can take it from there.
Thanks
Kawa
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know of any example sites for this pattern.

Describe your long running process. Is it a Java method or is it in a database tier?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic