java http default timeout

C

clir

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
 
J

jon

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

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>
 
C

clir

thanks.
My issue is not from the server side but from my application.
My application is like IE, it connects to a http server.
 
G

George Daswani

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.
 
L

Lew

George said:
[top=posted message in response to:]


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?
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

George said:
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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,297
Latest member
EngineerD

Latest Threads

Top