You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Justin Ruthenbeck <ju...@nextengine.com> on 2003/01/14 20:55:38 UTC

Re: forcing a jsp page to reload/refresh when backend data changes

Hi Jeff --

Once your jsp outputs its data, its job is done and
there is no opportunity for it to update anything.
The only way data can be updated is if the client
requests it, which means you'll have to force the
client to refresh.  If it's a browser, set the
appropriate header or include the correct HTML
tag (I don't know the currently "best" way to do this,
but you specify how often you want to refresh and the
URL to get -- google for "HTTP-EQUIV=Refresh").
This is only an approximation of what you're trying to
do ... if you want live communication between server
and client, you'll need something on the client to
listen to the socket (and applet would work) and act
accordingly.

Hope that's enough to get you going... let me know if
you need more specifics.

justin


At 11:08 AM 1/14/2003, you wrote:
>Hello!
>
>Forgive this very newbie-ish question. If someone
>could point me in the right direction I would
>appreciate it.
>
>Is it possible/feasible to have .jsp page refresh the
>data it's displaying when the data on the backend
>changes? For example if I have a .jsp page that
>queries and displays data from a database, can the
>page be coded to monitor the data and when it changes,
>refresh what is displayed in the user's browser?
>
>I hope the question makes sense.
>
>thanks!
>-jeff
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
>http://mailplus.yahoo.com
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>


____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr@nextengine.com
Confidential -
    See http://www.nextengine.com/confidentiality.php
____________________________________


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: forcing a jsp page to reload/refresh when backend data changes

Posted by Justin Ruthenbeck <ju...@nextengine.com>.
Don't know if Jeff's interested in this much depth,
but adding to Nick's method ...  :)

At 04:20 AM 1/15/2003, you wrote:
>Adding to Justin's method, you can make this polling a more subtle event
>by placing a polling jsp page in a frameset with your jsp page, but have
>the polling page take up no visible space.
>
>So in effect you divide it into 2 pages: the original data diplay page and
>an invisible "polling" page that only check to see it the datasource has
>changed (by getting a rowcount, for example).
>
>The polling jsp will poll the data source a a given time interval
>and if the data has changed, the polling page can use javascript
>to force the data display page to resubmit to ge the new data.

Alternately, the polling page could receive an html response that
runs a self-contained javascript method onLoad. If new data exists,
this method could update the visible frame with the data. If no new
data exists, it would do nothing.

>This way you have 2 advantages:
>
>1) The polling page just check to see if the data has changed and
>does not bring back the entire data set every time
>
>2) the data display page only resubmits back to the datasource
>only when the datasource has changed.

The contents of the visible frame (data the user is inputting,
for example) is maintained because the page is never actually
refreshed from scratch.  You get the effect of magical server-
initiated data updates without any server-inited updates (or
magic)  ;)


>- Nick

justin



>On Tue, 14 Jan 2003, Justin Ruthenbeck wrote:
>
> >
> > Hi Jeff --
> >
> > Once your jsp outputs its data, its job is done and
> > there is no opportunity for it to update anything.
> > The only way data can be updated is if the client
> > requests it, which means you'll have to force the
> > client to refresh.  If it's a browser, set the
> > appropriate header or include the correct HTML
> > tag (I don't know the currently "best" way to do this,
> > but you specify how often you want to refresh and the
> > URL to get -- google for "HTTP-EQUIV=Refresh").
> > This is only an approximation of what you're trying to
> > do ... if you want live communication between server
> > and client, you'll need something on the client to
> > listen to the socket (and applet would work) and act
> > accordingly.
> >
> > Hope that's enough to get you going... let me know if
> > you need more specifics.
> >
> > justin
> >
> >
> > At 11:08 AM 1/14/2003, you wrote:
> > >Hello!
> > >
> > >Forgive this very newbie-ish question. If someone
> > >could point me in the right direction I would
> > >appreciate it.
> > >
> > >Is it possible/feasible to have .jsp page refresh the
> > >data it's displaying when the data on the backend
> > >changes? For example if I have a .jsp page that
> > >queries and displays data from a database, can the
> > >page be coded to monitor the data and when it changes,
> > >refresh what is displayed in the user's browser?
> > >
> > >I hope the question makes sense.
> > >
> > >thanks!
> > >-jeff
> > >
> > >__________________________________________________
> > >Do you Yahoo!?
> > >Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > >http://mailplus.yahoo.com
> > >
> > >--
> > >To unsubscribe, 
> e-mail:   <ma...@jakarta.apache.org>
> > >For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> >
> >
> > ____________________________________
> > Justin Ruthenbeck
> > Software Engineer, NextEngine Inc.
> > justinr@nextengine.com
> > Confidential -
> >     See http://www.nextengine.com/confidentiality.php
> > ____________________________________
> >
> >
> > --
> > To unsubscribe, 
> e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> >
> >
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>


____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr@nextengine.com
Confidential -
    See http://www.nextengine.com/confidentiality.php
____________________________________


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: forcing a jsp page to reload/refresh when backend data changes

Posted by Sean Dockery <se...@sbdconsultants.com>.
Other alternatives which you should consider...

1) Deploy an applet that displays the information that you expect to 
change.  Then you can manage how often the applet checks for changes and 
refreshes its own view.  The implication is that your users will require to 
have a JRE installed.

2) Declare a META-tag in your page's HEAD to periodically refresh the page.


At 14:25 2003-02-04, you wrote:
>Nick,
>
>I like this idea. Do you know of any examples that
>make use of this concept? What code would I use
>(generically) to have the invisible frame force a
>resubmit on the viewable frame?
>
>Have you ever worked with pushlets? Are they worth
>messing with?
>
>thanks,
>-jeff
>--- Nick Sophinos <to...@itv-tech.com> wrote:
> > Adding to Justin's method, you can make this polling
> > a more subtle event
> > by placing a polling jsp page in a frameset with
> > your jsp page, but have
> > the polling page take up no visible space.
> >
> > So in effect you divide it into 2 pages: the
> > original data diplay page and
> > an invisible "polling" page that only check to see
> > it the datasource has
> > changed (by getting a rowcount, for example).
> >
> > The polling jsp will poll the data source a a given
> > time interval
> > and if the data has changed, the polling page can
> > use javascript
> > to force the data display page to resubmit to ge the
> > new data.
> >
> > This way you have 2 advantages:
> >
> > 1) The polling page just check to see if the data
> > has changed and
> > does not bring back the entire data set every time
> >
> > 2) the data display page only resubmits back to the
> > datasource
> > only when the datasource has changed.
> >
> > - Nick
> >
> >
> >
> >
> >
> >
> > On Tue, 14 Jan 2003, Justin Ruthenbeck wrote:
> >
> > >
> > > Hi Jeff --
> > >
> > > Once your jsp outputs its data, its job is done
> > and
> > > there is no opportunity for it to update anything.
> > > The only way data can be updated is if the client
> > > requests it, which means you'll have to force the
> > > client to refresh.  If it's a browser, set the
> > > appropriate header or include the correct HTML
> > > tag (I don't know the currently "best" way to do
> > this,
> > > but you specify how often you want to refresh and
> > the
> > > URL to get -- google for "HTTP-EQUIV=Refresh").
> > > This is only an approximation of what you're
> > trying to
> > > do ... if you want live communication between
> > server
> > > and client, you'll need something on the client to
> > > listen to the socket (and applet would work) and
> > act
> > > accordingly.
> > >
> > > Hope that's enough to get you going... let me know
> > if
> > > you need more specifics.
> > >
> > > justin
> > >
> > >
> > > At 11:08 AM 1/14/2003, you wrote:
> > > >Hello!
> > > >
> > > >Forgive this very newbie-ish question. If someone
> > > >could point me in the right direction I would
> > > >appreciate it.
> > > >
> > > >Is it possible/feasible to have .jsp page refresh
> > the
> > > >data it's displaying when the data on the backend
> > > >changes? For example if I have a .jsp page that
> > > >queries and displays data from a database, can
> > the
> > > >page be coded to monitor the data and when it
> > changes,
> > > >refresh what is displayed in the user's browser?
> > > >
> > > >I hope the question makes sense.
> > > >
> > > >thanks!
> > > >-jeff
> > > >
> > >
> > >__________________________________________________
> > > >Do you Yahoo!?
> > > >Yahoo! Mail Plus - Powerful. Affordable. Sign up
> > now.
> > > >http://mailplus.yahoo.com
> > > >
> > > >--
> > > >To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > >For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> > >
> > > ____________________________________
> > > Justin Ruthenbeck
> > > Software Engineer, NextEngine Inc.
> > > justinr@nextengine.com
> > > Confidential -
> > >     See
> > http://www.nextengine.com/confidentiality.php
> > > ____________________________________
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
>http://mailplus.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

Sean Dockery
sean@sbdconsultants.com
Certified Java Web Component Developer
Certified Delphi Programmer
SBD Consultants
http://www.sbdconsultants.com



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: forcing a jsp page to reload/refresh when backend data changes

Posted by Jeff Ousley <je...@yahoo.com>.
Nick,

I like this idea. Do you know of any examples that
make use of this concept? What code would I use
(generically) to have the invisible frame force a
resubmit on the viewable frame?

Have you ever worked with pushlets? Are they worth
messing with?

thanks,
-jeff
--- Nick Sophinos <to...@itv-tech.com> wrote:
> Adding to Justin's method, you can make this polling
> a more subtle event
> by placing a polling jsp page in a frameset with
> your jsp page, but have
> the polling page take up no visible space.
> 
> So in effect you divide it into 2 pages: the
> original data diplay page and 
> an invisible "polling" page that only check to see
> it the datasource has
> changed (by getting a rowcount, for example).  
> 
> The polling jsp will poll the data source a a given
> time interval
> and if the data has changed, the polling page can
> use javascript
> to force the data display page to resubmit to ge the
> new data.
> 
> This way you have 2 advantages:
> 
> 1) The polling page just check to see if the data
> has changed and
> does not bring back the entire data set every time
> 
> 2) the data display page only resubmits back to the
> datasource
> only when the datasource has changed. 
> 
> - Nick
> 
> 
> 
> 
> 
> 
> On Tue, 14 Jan 2003, Justin Ruthenbeck wrote:
> 
> > 
> > Hi Jeff --
> > 
> > Once your jsp outputs its data, its job is done
> and
> > there is no opportunity for it to update anything.
> > The only way data can be updated is if the client
> > requests it, which means you'll have to force the
> > client to refresh.  If it's a browser, set the
> > appropriate header or include the correct HTML
> > tag (I don't know the currently "best" way to do
> this,
> > but you specify how often you want to refresh and
> the
> > URL to get -- google for "HTTP-EQUIV=Refresh").
> > This is only an approximation of what you're
> trying to
> > do ... if you want live communication between
> server
> > and client, you'll need something on the client to
> > listen to the socket (and applet would work) and
> act
> > accordingly.
> > 
> > Hope that's enough to get you going... let me know
> if
> > you need more specifics.
> > 
> > justin
> > 
> > 
> > At 11:08 AM 1/14/2003, you wrote:
> > >Hello!
> > >
> > >Forgive this very newbie-ish question. If someone
> > >could point me in the right direction I would
> > >appreciate it.
> > >
> > >Is it possible/feasible to have .jsp page refresh
> the
> > >data it's displaying when the data on the backend
> > >changes? For example if I have a .jsp page that
> > >queries and displays data from a database, can
> the
> > >page be coded to monitor the data and when it
> changes,
> > >refresh what is displayed in the user's browser?
> > >
> > >I hope the question makes sense.
> > >
> > >thanks!
> > >-jeff
> > >
> >
> >__________________________________________________
> > >Do you Yahoo!?
> > >Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> > >http://mailplus.yahoo.com
> > >
> > >--
> > >To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> > >For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> > 
> > 
> > ____________________________________
> > Justin Ruthenbeck
> > Software Engineer, NextEngine Inc.
> > justinr@nextengine.com
> > Confidential -
> >     See
> http://www.nextengine.com/confidentiality.php
> > ____________________________________
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> > 
> > 
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: forcing a jsp page to reload/refresh when backend data changes

Posted by Nick Sophinos <to...@itv-tech.com>.
Adding to Justin's method, you can make this polling a more subtle event
by placing a polling jsp page in a frameset with your jsp page, but have
the polling page take up no visible space.

So in effect you divide it into 2 pages: the original data diplay page and 
an invisible "polling" page that only check to see it the datasource has
changed (by getting a rowcount, for example).  

The polling jsp will poll the data source a a given time interval
and if the data has changed, the polling page can use javascript
to force the data display page to resubmit to ge the new data.

This way you have 2 advantages:

1) The polling page just check to see if the data has changed and
does not bring back the entire data set every time

2) the data display page only resubmits back to the datasource
only when the datasource has changed. 

- Nick






On Tue, 14 Jan 2003, Justin Ruthenbeck wrote:

> 
> Hi Jeff --
> 
> Once your jsp outputs its data, its job is done and
> there is no opportunity for it to update anything.
> The only way data can be updated is if the client
> requests it, which means you'll have to force the
> client to refresh.  If it's a browser, set the
> appropriate header or include the correct HTML
> tag (I don't know the currently "best" way to do this,
> but you specify how often you want to refresh and the
> URL to get -- google for "HTTP-EQUIV=Refresh").
> This is only an approximation of what you're trying to
> do ... if you want live communication between server
> and client, you'll need something on the client to
> listen to the socket (and applet would work) and act
> accordingly.
> 
> Hope that's enough to get you going... let me know if
> you need more specifics.
> 
> justin
> 
> 
> At 11:08 AM 1/14/2003, you wrote:
> >Hello!
> >
> >Forgive this very newbie-ish question. If someone
> >could point me in the right direction I would
> >appreciate it.
> >
> >Is it possible/feasible to have .jsp page refresh the
> >data it's displaying when the data on the backend
> >changes? For example if I have a .jsp page that
> >queries and displays data from a database, can the
> >page be coded to monitor the data and when it changes,
> >refresh what is displayed in the user's browser?
> >
> >I hope the question makes sense.
> >
> >thanks!
> >-jeff
> >
> >__________________________________________________
> >Do you Yahoo!?
> >Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> >http://mailplus.yahoo.com
> >
> >--
> >To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> >For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> ____________________________________
> Justin Ruthenbeck
> Software Engineer, NextEngine Inc.
> justinr@nextengine.com
> Confidential -
>     See http://www.nextengine.com/confidentiality.php
> ____________________________________
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>