delay page loading


Web tier: servlets, JSP, Web frameworks: delay page loading

  1. delay page loading (2 messages)


     Does anyone know how to force a delay between the time a user hits the submit button and the point at which a jsp loads in the browser? I'm desiging an app where I'd like to build in a random 5 to 10 second delay in the server response time.

    Thanks for the help,

    Threaded Messages (2)

  2. delay page loading[ Go to top ]

    You can always do this with a simple thread:
    try {
      Thread.sleep(1000); // wait for one second
    } catch (InterruptedException e) {}

    Use the random functionality to create a long between 5000 and 10000 and you got yourself a random deply.

  3. delay page loading[ Go to top ]

    Thanks - that worked out well.