> Programming Languages > Java
Various Topics Home | Disclaimer | Report Adult Posts

Various Topics on Java



Java - "Realtime servlets? Newbie Question" in Programming Languages


Old 09-01-2004   #1
..i..
 
Default Realtime servlets? Newbie Question

'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.
 
Old 09-01-2004   #2
..d..
 
Default Re: Realtime servlets? Newbie Question

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 do***ent:
<meta http-equiv="refresh" content="XXX">
(where XXX is the number of seconds)

 
Old 09-01-2004   #3
..lv.. ..erm..
 
Default Re: Realtime servlets? Newbie Question


"Sudsy" <bitbucket44@hotmail.com> wrote in message
news:4135E935.9050701@hotmail.com...
> 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 do***ent:
> <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


 
Old 09-02-2004   #4
..d..
 
Default Re: Realtime servlets? Newbie Question

Silvio Bierman wrote:
> "Sudsy" <bitbucket44@hotmail.com> wrote in message
> news:4135E935.9050701@hotmail.com...
>
>>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 do***ent:
>><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.

 
Old 09-02-2004   #5
..lv.. ..erm..
 
Default Re: Realtime servlets? Newbie Question


"Sudsy" <bitbucket44@hotmail.com> wrote in message
news:41364712.7040207@hotmail.com...
> Silvio Bierman wrote:
> > "Sudsy" <bitbucket44@hotmail.com> wrote in message
> > news:4135E935.9050701@hotmail.com...
> >
> >>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 do***ent:
> >><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


 
Old 09-06-2004   #6
..i..
 
Default Re: Realtime servlets? Newbie Question

Thanks for the responses. That should do the trick.

"Silvio Bierman" <sbierman@idfix.nl> wrote in message news:<41370c38$0$10528$e4fe514c@news.xs4all.nl>...
> "Sudsy" <bitbucket44@hotmail.com> wrote in message
> news:41364712.7040207@hotmail.com...
> > Silvio Bierman wrote:
> > > "Sudsy" <bitbucket44@hotmail.com> wrote in message
> > > news:4135E935.9050701@hotmail.com...
> > >
> > >>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 do***ent:
> > >><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

 

Thread Tools
Display Modes





Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0