This discussion is archived
4 Replies Latest reply: Dec 10, 2012 2:53 AM by 655260 RSS

java - jsp browser - long-running app - avoid timeout and refresh page

655260 Newbie
Currently Being Moderated
Hello. I have a java-jsp program that I initiate from a webpage using internet explorer.

I click on a button and then the program runs a simulation which loops for an extended period.

I guess the problem is that the browser times out after about five or ten minutes.

-----

How do I run a program from the browser that keeps running for a very long time?

-----

I also want to update the page with each loop of the program, in which a loop count and status code generated by the program is displayed on the web page for the entire duration of the program.

-----

Any suggestions are greatly appreciated.
  • 1. Re: java - jsp browser - long-running app - avoid timeout and refresh page
    Kayaman Guru
    Currently Being Moderated
    user652257 wrote:
    Hello. I have a java-jsp program that I initiate from a webpage using internet explorer.
    Do you need to use IE?
    I click on a button and then the program runs a simulation which loops for an extended period.
    How long is an extended period?
    I guess the problem is that the browser times out after about five or ten minutes.
    Yea, they have a habit of doing that.
    How do I run a program from the browser that keeps running for a very long time?
    Either fiddle with the timeout settings, or modify the program so that you don't need to wait for a response for that long.
    I also want to update the page with each loop of the program, in which a loop count and status code generated by the program is displayed on the web page for the entire duration of the program.
    Then go for it. Just stream the content back to the browser (I'd do this from a servlet instead of JSP).

    Edited by: Kayaman on Dec 10, 2012 10:22 AM
  • 2. Re: java - jsp browser - long-running app - avoid timeout and refresh page
    655260 Newbie
    Currently Being Moderated
    Thanks for helping.

    Yes, I am also using servlets.

    I intend to have the program run for an hour or more.

    I prefer to do this in a browser - that fits best with my current development framework.

    -----

    Can you suggest a few keywords I can search for to learn how to adjust the timeout and do the streaming?

    I will begin searching on these topics.
  • 3. Re: java - jsp browser - long-running app - avoid timeout and refresh page
    Kayaman Guru
    Currently Being Moderated
    user652257 wrote:
    I prefer to do this in a browser
    I didn't ask that. Internet Explorer isn't the only browser available.
    Can you suggest a few keywords I can search for to learn how to adjust the timeout
    How about "browser timeout"?
    and do the streaming?
    That's just writing to the outputstream from a servlet, you should definitely know how to do that.
  • 4. Re: java - jsp browser - long-running app - avoid timeout and refresh page
    655260 Newbie
    Currently Being Moderated
    Thanks again.

    Internet Explorer is the only browser I have ever tried. Which do you recommend?

    ----

    In my servlet, I use this command to output data to display in the browser:

    out.println("hello world");

    But this method only displays the data after the program stops running.

    -----

    I do not know of any other method. I only learn new things when it becomes absolutely necessary. ;)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points