How do I specify multiple listener classes in web.xml? I tried searching the web without luck.
I tried the following, but it seems that it doesn't work:
<listener>
<listener-class>
org.obliquid.web.StartAndStop
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
Servlet Listener is used for listening to events in a web container, such as when you create a session or place an attribute in a session or if you passivate and activate in another container, to subscribe to these events you can configure listener in web. xml, for example, HttpSessionListener.
That is the correct syntax. What "didn't work"? It's not this bit, unless perhaps you mean there's an XML parsing error because it's in the wrong place in the doc.
EDIT: the 'right' place if I recall correctly is before <servlet>
but I am not sure if the latest XSD schemas do restrict that. You would get a clear parsing error if this was the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With