You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by dzenanr <dz...@gmail.com> on 2007/12/17 23:16:27 UTC

How to set the current application to a new thread?

I have been trying to develop a slideshow with a new thread that will show a
new page every 15 seconds.

I get the following message:

22:12:29.188 EVENT  Started SocketListener on 0.0.0.0:8081
22:12:29.188 EVENT  Started org.mortbay.jetty.Server@422ede
22:12:38.427 EVENT  Started HttpContext[/]
Exception in thread "Timer-0" org.apache.wicket.WicketRuntimeException:
There is no application attached to current thread Timer-0
	at org.apache.wicket.Application.get(Application.java:175)
	at org.apache.wicket.Component.getApplication(Component.java:1044)
	at
course.wicket.lecture.slide.SlideshowPage$SlideshowTimerTask.run(SlideshowPage.java:46)
	at java.util.TimerThread.mainLoop(Timer.java:512)
	at java.util.TimerThread.run(Timer.java:462)

I cannot use the Application.set method (it is not a part of the public
API). 

How should I set the current application to a new thread?

-----
Dzenan
-- 
View this message in context: http://www.nabble.com/How-to-set-the-current-application-to-a-new-thread--tp14375785p14375785.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to set the current application to a new thread?

Posted by Igor Vaynberg <ig...@gmail.com>.
you cannot push a page to the browser, the browser has to request it.
so what i would do is have a timer on client side that requests a new
page every x seconds.

see AbstractAjaxTimerBehavior

-igor


On Dec 17, 2007 2:16 PM, dzenanr <dz...@gmail.com> wrote:
>
> I have been trying to develop a slideshow with a new thread that will show a
> new page every 15 seconds.
>
> I get the following message:
>
> 22:12:29.188 EVENT  Started SocketListener on 0.0.0.0:8081
> 22:12:29.188 EVENT  Started org.mortbay.jetty.Server@422ede
> 22:12:38.427 EVENT  Started HttpContext[/]
> Exception in thread "Timer-0" org.apache.wicket.WicketRuntimeException:
> There is no application attached to current thread Timer-0
>         at org.apache.wicket.Application.get(Application.java:175)
>         at org.apache.wicket.Component.getApplication(Component.java:1044)
>         at
> course.wicket.lecture.slide.SlideshowPage$SlideshowTimerTask.run(SlideshowPage.java:46)
>         at java.util.TimerThread.mainLoop(Timer.java:512)
>         at java.util.TimerThread.run(Timer.java:462)
>
> I cannot use the Application.set method (it is not a part of the public
> API).
>
> How should I set the current application to a new thread?
>
> -----
> Dzenan
> --
> View this message in context: http://www.nabble.com/How-to-set-the-current-application-to-a-new-thread--tp14375785p14375785.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org