get httpSessions from context

Hello,

Does anybody know how a servlet can access the HttpSessions (plural) from a servlet.

For example: if one were to remove a user from a database of users, one would also wish to invalidate their HttpSession to avoid a programme getting 'confused'.

Thanks in advance,

Bamkin

[311 byte] By [bamkin-ov-lestaa] at [2007-11-27 9:31:28]
# 1
Implement a HttpSessionListener and collect the sessions in a static backing map.
BalusCa at 2007-7-12 22:46:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Is this the only way?They must be stored somewhere (although not necessarily accessable) at context level surely... This way I would have two sets of references to the objects which would appear inefficientBamkin
bamkin-ov-lestaa at 2007-7-12 22:46:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Then just store it in the servletcontext? It was a basic suggestion to help you in the right direction and think further about the final solution.
BalusCa at 2007-7-12 22:46:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Thanks for your thoughts :-)
bamkin-ov-lestaa at 2007-7-12 22:46:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...