Hi Jothi,
"Closedown of a web application triggers a call to the matching closedown events in session and context listeners. The order in which listeners are
called is then in reverse order of deployment description declaration, with session listeners being processed before context listeners." What i think is when we close the application , the order of execution of the listeners would be the order in which the Application is brought down.
I would say this is quite similar to delete a row in a DB table whose Primary Key is used as a Foreign key in another table.( Situation in case of Child records) We need to do a CASCADE i.e we need to first delete the child and then the parent record.
In similar lines , what i feel is we first act upon the
servlet specific , session specific listeners and then act upon the more generic ones later.