You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by YagNesh <yr...@gmail.com> on 2007/03/23 06:12:55 UTC
auto-refreshing stock price
Hi,
We have been trying to create a trading portfolio page which lists about 20
stocks with prices.
We need that stock price to be refreshed every 20-30 seconds after fetching
the price from server, indirectly from database.
I had tried to use Struts2 tag <s:div>one per stock data, but it overload
the server with lots of requests and fails.
Please provide some guideline with AJAX approach to refresh.
Thank you
--
View this message in context: http://www.nabble.com/auto-refreshing-stock-price-tf3451963.html#a9629081
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: auto-refreshing stock price
Posted by Lance <la...@marketpipe.com>.
You could use DWR's reverse ajax which allows the server to push data to
clients rather than the clients polling which can be inefficient.
http://getahead.org/dwr/changelog/dwr20m1
http://getahead.org/dwr/download
YagNesh wrote:
> Hi,
>
> We have been trying to create a trading portfolio page which lists about 20
> stocks with prices.
> We need that stock price to be refreshed every 20-30 seconds after fetching
> the price from server, indirectly from database.
>
> I had tried to use Struts2 tag <s:div>one per stock data, but it overload
> the server with lots of requests and fails.
>
> Please provide some guideline with AJAX approach to refresh.
>
> Thank you
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: auto-refreshing stock price
Posted by Musachy Barroso <mu...@gmail.com>.
That would be the same thing as the timee on the div tag, DWR has a polling
mode, which uses a timer, and another mode(comet? not sure about the name)
that keeps an open connection with the client, and "pushes" the data.
musachy
On 3/23/07, stanlick@gmail.com <st...@gmail.com> wrote:
>
> How about using Prototype.js? It has a class specifically designed for
> AJAX
> "timer" behavior.
>
> On 3/23/07, YagNesh <yr...@gmail.com> wrote:
> >
> >
> > Hi,
> >
> > We have been trying to create a trading portfolio page which lists about
> > 20
> > stocks with prices.
> > We need that stock price to be refreshed every 20-30 seconds after
> > fetching
> > the price from server, indirectly from database.
> >
> > I had tried to use Struts2 tag <s:div>one per stock data, but it
> overload
> > the server with lots of requests and fails.
> >
> > Please provide some guideline with AJAX approach to refresh.
> >
> > Thank you
> > --
> > View this message in context:
> >
> http://www.nabble.com/auto-refreshing-stock-price-tf3451963.html#a9629081
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> Scott
> stanlick@gmail.com
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
Re: auto-refreshing stock price
Posted by st...@gmail.com.
How about using Prototype.js? It has a class specifically designed for AJAX
"timer" behavior.
On 3/23/07, YagNesh <yr...@gmail.com> wrote:
>
>
> Hi,
>
> We have been trying to create a trading portfolio page which lists about
> 20
> stocks with prices.
> We need that stock price to be refreshed every 20-30 seconds after
> fetching
> the price from server, indirectly from database.
>
> I had tried to use Struts2 tag <s:div>one per stock data, but it overload
> the server with lots of requests and fails.
>
> Please provide some guideline with AJAX approach to refresh.
>
> Thank you
> --
> View this message in context:
> http://www.nabble.com/auto-refreshing-stock-price-tf3451963.html#a9629081
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Scott
stanlick@gmail.com