• 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

Page cannot be displayed

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
we are doing big calculation in the web page , and the browser times out with 'Page cannot be displayed' message. This happens exactly after one hour.Is there any setting in websphere or is there any way I can avoid this Page cannot be displayed message and make this calcultion complete.
Thanks
Ravi
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes don't do that. Do the calculation asynchronously and then use a Meta tag to refresh the page every so often to check back for the results. Of course you're going to get a page time out at the browser end if it takes an hour to create a page.
So do one of these two things instead. The first is appropriate for WebSphere 4.0, while the second is appropriate for WebSphere 5.0.
(1) In your servlet spin off a thread that does the calculation and writes the result to something shared like a database row or an in-memory static hashtable that you store the key for in the HttpSession.
After kicking off the thread, return the page to the user immediately with a "please wait" message. Embed a META tag in the Output so that the page refreshes itself every 15-30 seconds or so. When it refreshes itself, check to see if the thread is still running by looking in the hashtable for the result. If it is, then return the page with the META tag still in place and the "please wait" message. If it's not, then get the calculation result from the hashtable and displaying the result.
(2) Rather than spin off a thread, do nearly the same thing except put the logic to do the calculation in a message-driven bean. In your servlet, first put a message on the queue the bean listens on. Make sure that on that message you set the reply-to-queue to be a temporary queue that you hold in the HttpSession.
Then in your Servlet, when the page is refreshed, look in the queue and see if you have a result.
Kyle
 
Ravi Shankar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Kyle
Will do the first one as it is Websphere 4.05.
Ravi
 
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think an email reply when the calculation is done seems interesting too.
 
reply
    Bookmark Topic Watch Topic
  • New Topic