Reputation: 46
First of all, sorry if I do something wrong, it's my first post on stackOverflow. Now, my question:
Is it possible to listen to an event thowed by Spring in Tapestry component? The event (ShopChangedEvent ) is published with ApplicationEventPublisher, from a Spring front service, and i want to listen to this event in a front Tapestry component. I tried adding"implements ApplicationListener" to my Tapestry component and overriding the onApplicationEvent method.
Thank for all,
Alberto
Upvotes: 1
Views: 80
Reputation: 891
It's possible, but it's probably not what you want.
Tapestry components "live" in the scope of HTTP requests. Every time you use a UI component in a TML-markup Tapestry creates just one instance of that component and shares it across all HTTP requests.
So even if you subscribe your UI component to ApplicationEventPublisher
you won't be able to properly "receive" an event in the right request cycle.
Upvotes: 1