File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Http timeout java 1.4.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Http timeout java 1.4.2" Watch "Http timeout java 1.4.2" New topic
Author

Http timeout java 1.4.2

Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
It is possible to make a timeout in the following code, or do i have to make a thread for timeouts on a http connection ???
Im using java 1.4.2
URL url = new URL(ipadresse);
URLConnection urlConnection = url.openConnection();
urlConnection.setDoOutput(true);
Frank Jacobsen
SCJP
Chris Stehno
Ranch Hand

Joined: Feb 26, 2001
Posts: 180
I ran into the same problem and found no direct solution using core Java classes. I ended up using the Jakarta Commons HttpClient API (http://jakarta.apache.org/commons/httpclient), which does handle timeout very well. If you are trying to post data to a URL or any other HTTP operations, it is the way to go.
Hope this helps.


- Chris Stehno, SCPJ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Http timeout java 1.4.2
 
Similar Threads
Sample code of Applet call servlet
UrlConnections versus HttpURLConnection versus Apaches HttpClient
where can I find an example to use socket to read a web page?
Open a URL from java swing application or java standalone program
I got it!