Re: How to implement timing refresh of WebObjects page
Re: How to implement timing refresh of WebObjects page
- Subject: Re: How to implement timing refresh of WebObjects page
- From: "Jerry W. Walker" <email@hidden>
- Date: Sun, 16 Sep 2007 12:25:10 -0400
Hi, Andrew,
This is probably most easily done by having the browser refresh the
page. HTTP is not a push technology. The browser has to make a
request before the app can send it anything.
The easiest way to do this is to add something like the following to
the header of your page:
<meta http-equiv="refresh" content="5">
That would cause the browser to re-request the page every 5 seconds.
However, simply doing this will probably get you a "Backtracked too
far" error message in a few refreshes. To address this problem, Chuck
Hill suggested the following on the mailing list a while back:
============================================
I'd make a component to drop in the HEAD, here is quick sketch:
---
<webobject name="RefreshTag"/>
</head>
...
---
RefreshTag: WOString {
value = refreshTag;
escapeHTML = false;
}
---
/**
* Returns a refresh meta tag to refresh this page in the number
of seconds indicated by the metaRefresh
* or null if that is not bound. The refresh references a non-
existant action method so that no side effects
* occur as a result of the page being refreshed.
*
* @return refresh meta tag to refresh this page or null if
refreshing is not desired
*/
public String refreshTag()
{
Object metaRefresh = valueForBinding(Meta_Refresh);
if (metaRefresh != null)
{
return "<meta http-equiv=\"refresh\" content=\"" +
metaRefresh + ";" + context().componentActionURL() + "\">";
}
return null;
}
============================================
Hope this helps.
Regards,
Jerry
On Sep 16, 2007, at 12:06 PM, Andrew.Yi.Huang wrote:
Hi
How can I implement timing refresh of WebObjects page? For example,
refresh a page every 5 seconds! Can I implement a WOComponent as a
thread class? And put them together into some Thread Pool? Thank
you for any suggestions!
Best Regards!
Andrew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial
Strength Internet Enabled Systems
email@hidden
203 278-4085 office
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden