Thread: Java: Set timeout values?

  1. #1
    Unregistered
    Guest

    Question Java: Set timeout values?

    Is it possible to set a timeout value for functions or URL connections in Java?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    I dont know exactly what you mean.

    Do you mean the setTimeout() function for JavaScript?

  3. #3
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    are you looking for a redirect? Or a script that just times out after a period of time?

  4. #4
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    Code:
    <HTML>
    <BODY onLoad="window.setTimeout("window.url.href='main.html'",5000)">
    redirecting in 5 seconds....
    </BODY>
    </HTML>

  5. #5
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    there is also a meta tag to do a redirect that is shorter but i can't seem to locate it at the moment...

  6. #6
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    ok.. so it's not shorter, but here it is...
    Code:
     
    <META HTTP-EQUIV="Refresh" CONTENT="3;URL=http://www.some.org/some.html">

  7. #7
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    Use the meta tag, it is more portable. Just damn hard to remember.

  8. #8
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    OMG... we agree on something... sorry.. i'm carrying threads beyond their bounds...

    *whew*

    ok, i'm done with cheap shots for today... i'm outta here...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. optimising program
    By SONU in forum C Programming
    Replies: 1
    Last Post: 05-18-2008, 10:28 AM
  2. Find all possible subset of a given set
    By Downnin in forum C++ Programming
    Replies: 7
    Last Post: 11-09-2005, 02:03 PM
  3. "if you love someone" :D
    By Carlos in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 10-02-2003, 01:10 AM
  4. Java woes
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 07-06-2003, 12:37 AM
  5. Visual J#
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 10-08-2001, 02:41 PM