Realtime servlets? Newbie Question

Discussion in 'Java' started by Brian, Sep 1, 2004.

  1. Brian

    Brian Guest

    'Ello,

    I'm interested in creating a page which will display some information
    and update itself so many seconds without the need to hit the Refresh
    button in the browser.

    Which technology do I want to look at to do this? I have been
    learning Tomcat5.0 and Java Servlets, and have had success with
    displaying the information I want. But now I want to take this to the
    next step and to be able to have the page update itself without the
    user having to Refresh.

    Thanks for any info.
    Brian, Sep 1, 2004
    #1
    1. Advertising

  2. Brian

    Sudsy Guest

    Brian wrote:
    > 'Ello,
    >
    > I'm interested in creating a page which will display some information
    > and update itself so many seconds without the need to hit the Refresh
    > button in the browser.
    >
    > Which technology do I want to look at to do this? <snip>


    Just use HTML/HTTP. Include something like this in your document:
    <meta http-equiv="refresh" content="XXX">
    (where XXX is the number of seconds)
    Sudsy, Sep 1, 2004
    #2
    1. Advertising

  3. "Sudsy" <> wrote in message
    news:...
    > Brian wrote:
    > > 'Ello,
    > >
    > > I'm interested in creating a page which will display some information
    > > and update itself so many seconds without the need to hit the Refresh
    > > button in the browser.
    > >
    > > Which technology do I want to look at to do this? <snip>

    >
    > Just use HTML/HTTP. Include something like this in your document:
    > <meta http-equiv="refresh" content="XXX">
    > (where XXX is the number of seconds)
    >


    Which can also be done by calling


    response.setHeader("refresh","XXX");

    prior to opening the output stream.

    An alternative is to include some JavaScript in the page that will set a
    timer to do the refresh.

    Silvio Bierman
    Silvio Bierman, Sep 1, 2004
    #3
  4. Brian

    Sudsy Guest

    Silvio Bierman wrote:
    > "Sudsy" <> wrote in message
    > news:...
    >
    >>Brian wrote:
    >>
    >>>'Ello,
    >>>
    >>>I'm interested in creating a page which will display some information
    >>>and update itself so many seconds without the need to hit the Refresh
    >>>button in the browser.
    >>>
    >>>Which technology do I want to look at to do this? <snip>

    >>
    >>Just use HTML/HTTP. Include something like this in your document:
    >><meta http-equiv="refresh" content="XXX">
    >>(where XXX is the number of seconds)
    >>

    >
    >
    > Which can also be done by calling
    >
    >
    > response.setHeader("refresh","XXX");
    >
    > prior to opening the output stream.


    Sure, if you're running a servlet. You'll note that the OP mentions
    "creating a page", not generating one from JSP or a servlet. I was
    just citing the LCD.
    Sudsy, Sep 1, 2004
    #4
  5. "Sudsy" <> wrote in message
    news:...
    > Silvio Bierman wrote:
    > > "Sudsy" <> wrote in message
    > > news:...
    > >
    > >>Brian wrote:
    > >>
    > >>>'Ello,
    > >>>
    > >>>I'm interested in creating a page which will display some information
    > >>>and update itself so many seconds without the need to hit the Refresh
    > >>>button in the browser.
    > >>>
    > >>>Which technology do I want to look at to do this? <snip>
    > >>
    > >>Just use HTML/HTTP. Include something like this in your document:
    > >><meta http-equiv="refresh" content="XXX">
    > >>(where XXX is the number of seconds)
    > >>

    > >
    > >
    > > Which can also be done by calling
    > >
    > >
    > > response.setHeader("refresh","XXX");
    > >
    > > prior to opening the output stream.

    >
    > Sure, if you're running a servlet. You'll note that the OP mentions
    > "creating a page", not generating one from JSP or a servlet. I was
    > just citing the LCD.
    >


    Based on the topic I concluded he was using servlets. In JSP it is also
    possible BTW, but you have to make sure you put the code in front of any
    output because otherwise you will get in invalid state exception.

    Silvio Bierman
    Silvio Bierman, Sep 2, 2004
    #5
  6. Brian

    Brian Guest

    Thanks for the responses. That should do the trick.

    "Silvio Bierman" <> wrote in message news:<41370c38$0$10528$4all.nl>...
    > "Sudsy" <> wrote in message
    > news:...
    > > Silvio Bierman wrote:
    > > > "Sudsy" <> wrote in message
    > > > news:...
    > > >
    > > >>Brian wrote:
    > > >>
    > > >>>'Ello,
    > > >>>
    > > >>>I'm interested in creating a page which will display some information
    > > >>>and update itself so many seconds without the need to hit the Refresh
    > > >>>button in the browser.
    > > >>>
    > > >>>Which technology do I want to look at to do this? <snip>
    > > >>
    > > >>Just use HTML/HTTP. Include something like this in your document:
    > > >><meta http-equiv="refresh" content="XXX">
    > > >>(where XXX is the number of seconds)
    > > >>
    > > >
    > > >
    > > > Which can also be done by calling
    > > >
    > > >
    > > > response.setHeader("refresh","XXX");
    > > >
    > > > prior to opening the output stream.

    > >
    > > Sure, if you're running a servlet. You'll note that the OP mentions
    > > "creating a page", not generating one from JSP or a servlet. I was
    > > just citing the LCD.
    > >

    >
    > Based on the topic I concluded he was using servlets. In JSP it is also
    > possible BTW, but you have to make sure you put the code in front of any
    > output because otherwise you will get in invalid state exception.
    >
    > Silvio Bierman
    Brian, Sep 6, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henrik H
    Replies:
    1
    Views:
    637
    Scott Allen
    Oct 25, 2004
  2. rawCoder
    Replies:
    2
    Views:
    4,828
    matrixfan33
    Jul 31, 2009
  3. Mohammad S Khan

    JDBC - Constructing a query realtime

    Mohammad S Khan, Oct 31, 2003, in forum: Java
    Replies:
    0
    Views:
    395
    Mohammad S Khan
    Oct 31, 2003
  4. nos
    Replies:
    1
    Views:
    302
    Bryce (Work)
    Apr 1, 2004
  5. Tony
    Replies:
    0
    Views:
    446
Loading...

Share This Page