• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying a message on the Browser till processing completes

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

In my application, I am processing a large file, wherein the system fetches the data from the file and updates it in the database. The problem is that this processing takes a lot of time (1 - 1.5 hours). This time cannot be reduced, hence I want the user to see a message for ex: "Please Wait ... Processing the Data...", But the browser times out. Hence, I want a solution whereby I can display that message to the user till the processing completes and then proceed with the next action.

I am currently using struts for the same.

Thanks
Mickey Smith.
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mickey

You may use Javascript for the same.
<html:submit value="Search" styleClass="buttons" onkklick="javascript:this.value=Please Wait ... Processing the Data...';this.disabled=true;document.searchForm.submit();"/>
 
Mickey Smith
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roshani,

I got your solution but my problem is a bit different. Can i have something whereby i can show that message before browser timeout occurs ?

Thanks,
Mickey
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This link has an example of one way to do it. I've adapted it for Struts by putting some of the code in an Action class that the authors put in a JSP, and found that it works just fine and solves the browser timeout problem. If you'd like to look at other solutions, just Google "JSP please wait message".
[ February 28, 2007: Message edited by: Merrill Higginson ]
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would question a design that displayed a "please wait" message for over an hour. Will the users really wait for that time period? What if they close their browser? Will they have a way to know if the processes finished?

I would suggest you look into a more elaborate background processing model where the user can submit a task and then a background process will process the task. Probably the easiest way of submitting the job and providing feedback to the user is to use a database table. Have the background process periodically update the task's status in the database and have the status page read the status from the database.

- Brent
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic