How to update the GUI from another thread?

前端 未结 2 953
长发绾君心
长发绾君心 2021-01-15 14:23

I have a problem with threads in my JSF application, maybe somebody could help me.

After the start I run new thread which is making some background

2条回答
  •  被撕碎了的回忆
    2021-01-15 14:25

    You can use JMS to communicate between the thread you've got running and your managed beans, but for the rest you'll need to use one of the push technologies as mentioned above.

    You could use the primefaces poll component if that's sufficient, otherwise the only push technology that works with jsf that I know of right now is icefaces push. Primefaces is coming out with a new websocket based push component that looks like it will be really nice, but I don't believe it's due to be finished for a couple of months (it showed up in the latest snapshot, but doesn't really do much yet and only works with jetty8). You could also do your own thing with the comet/atmosphere libraries, but having looked at that myself I can tell you those solutions would be a lot of work on your part, pretty much a custom implementation.

提交回复
热议问题