Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Servlets and the fly likes Setting Request - Response Time Out Programatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Setting Request - Response Time Out Programatically" Watch "Setting Request - Response Time Out Programatically" New topic

Setting Request - Response Time Out Programatically

Vikas Aggarwal
Ranch Hand

Joined: Jun 22, 2001
Posts: 140

One of my servlets is getting connected to a heavily loaded system and it is very frequest to get the request timeouts. This is fine as per requirements but we need to set the timeout period programatically (read from xml or properties file). Also in case of a time out (after timeout period) we need to show a page with message using JSP/Servlet "Sorry Server Is Not Available At The Moment."

Is there any way I can set the timeout value between request and response? Also how do I trap the timeout? This needs to be done programatically or using non-vendor dependent feature because our app needs to work on all servlet containers.

Thanks alot.

Vikas Aggarwal
chnaresh Cheedella

Joined: Nov 01, 2006
Posts: 7
You can put session time out in web.xml

there you specify the session time out.
and also put error page in that xml then whenever the session time has been over then it will displays that page.
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
As far as I aware of, it is a container specific configuration.

SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Setting Request - Response Time Out Programatically
It's not a secret anymore!