• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

RequestDispatcher.forward does not work

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Steps
1. test.jsp page
2. user presses a button and calls servlet
3. Servlet calls database procedure in DAO
4. servlet forwards the request to same jsp page.

Following is the code in Servlet,


The requestdDispatcher does not work if the database procedure takes more than 10 mins. Please let me know how to rectify this. There is no error, browser just keeps loading and nothing happens. Debug messages before forward was written to the console. Database procedure executes fine.
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The browser is likely timing out.

Shorten your cycle -- 10 minutes is a ridiculously long time to have a user stare at an unresponsive application. Heck, 10 seconds is a long time.

If you can't shorten the cycle, do the processing it in the background and let the user come back to see the results later.
 
arunkumar subramanian
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply. Is there a way I can set time out in browser to be like 30 mins.
 
Bear Bibeault
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. Besides, how would you get your users to do that?
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Bear suggested, you need to shorten the client wait time. 10 minutes is a very long time. Can you may be bring back partial information and then make another call to the database if the user indicates so. Most users will nto wait for 10 minutes anyway.
 
arunkumar subramanian
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your replies. I will try the one as you all said
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the parameter for setMaxInactiveInterval is expressed in seconds, whereas the one in the deployment descriptor is in minutes.

When we configure session timeout in web.xml, it is applicable to all the sessions created.

When we call setMaxInactiveInterval(int interval) on a session object, then the timeout is set only for that specific session object.

If you have specified a timeout value in web.xml and also calling setMaxInactiveInterval(int interval) on a session object, then for that session object, value set in setMaxInactiveInterval() will be considered for timeout.
 
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try setting Headers like connection keep-alive and also set the parameter for connection Time out in your server also .

Let me know whats the server you are using ??I may help you.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should not do let it take that long time. Around max 3 seconds is an acceptable response time. Otherwise users will likely abort the request. I suggest to let run it in the background and if necessary inform the end user about the status using ajaxical polls.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Bauke is Right.

Nobody will stick to your site if it takes such a long time .
This site is very much faster compared to sun site (sun takes a lot of time to login also) dont know why
 
Grow your own food... or this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic