Sorry, you're right. I should have started by saying that's a feature that I don't like too much (magic all around)
So, for a listener like <bean class="foo.BarListener" /> no work is needed because it should be covered by a param of DWRController.
For a complex listener we could have the new tag (<dwr:script-session.../>) or not.
Pros (of the new tag):
- The configuration is easier to understand
- It's more akin to the current way of doing things
- Beans can be defined in a different context than DWR (in a parent context for example)
Cons:
- It "pollutes" the XML
- It does not scale with the number of components.
The work to implement both alternatives seems similar. The tag requires a new method in the namespace handler. Otherwise we would probably need a BeanPostProcessor. It's just a guess but I think the later would be a bit slower. And, of course, it has to take care of the initialization order (ensure that DWR has been at least instantiated).
I think a <dwr:script-session-listener /> is feasible. Let me know if you're interested