Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

java http default timeout

Thread view: 
clir - 04 Apr 2007 16:09 GMT
Hi,

Can someone tell me what is the http default timeout value implemented
in Java?
What is the java property for setting the http timeout?

Thanks,

Christophe
jon - 04 Apr 2007 16:50 GMT
> Hi,
>
[quoted text clipped - 5 lines]
>
> Christophe

Christophe,

I'm a real novice, so I can only hope this helps.

The session configuration is described in the "web application
deployment descriptor file" (named web.xml).  The <session-config>
element configures session tracking for a web application.  Within
that, the <session-timeout> element contains the default session
timeout for the described web application.  The default is to never
timeout.  Values are integers that specify whole minutes.

I don't know of a way to override that descriptor from within the web
application itself, but I'm only a novice. Someone can help us by
calling me a stupid jerk and (maybe) gently describing how to do this.

--jondr

here is part of a web.xml file showing this:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        version="2.4">
.......
   <session-config>
       <session-timeout>
           30
       </session-timeout>
   </session-config>
.......
</web-app>
clir - 04 Apr 2007 18:08 GMT
thanks.
My issue is not from the server side but from my application.
My application is like IE, it connects to a http server.

> > Hi,
>
[quoted text clipped - 24 lines]
>
> here is part of a web.xml file showing this:

> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
[quoted text clipped - 9 lines]
> .......
> </web-app>
George Daswani - 04 Apr 2007 21:50 GMT
What JDK version are you using?

on 1.5+ you can set the timeout yourself..  There is *NO* default timeout
set on HTTPUrlConnection hence it'll block indefinitely.  On 1.4, you can
set some system properties to set a global timeout on all sockets, but
that's most likely not a good thing.

If you are stuck using older JDK's, then look at using apache's commons-http
instead.

> thanks.
> My issue is not from the server side but from my application.
[quoted text clipped - 43 lines]
>> .......
>> </web-app>
Lew - 04 Apr 2007 23:48 GMT
> [top=posted message in response to:]

"clir" <christophe.leroquais@gmail.com> wrote in another top-posted message ...

A: Because it makes posts harder to read.
Q: Why is it bad?
A: Posting the reply to a message above the quoted text instead of in line.
Q: What is top-posting?

Signature

Lew

Arne Vajhøj - 05 Apr 2007 01:53 GMT
> What JDK version are you using?
>
[quoted text clipped - 5 lines]
> If you are stuck using older JDK's, then look at using apache's commons-http
> instead.

In a client app it may be OK.

And to save the original poster the trouble of finding it:

System.setProperty( "sun.net.client.defaultConnectTimeout", "100");

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.