Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3


One way of invalidating a session; contributed by Ray Clough.

Code Block
titleSession Invalidationjava
// Code fragment from class implementing SessionAware containing the 
// session map in a instance variable "session". Attempting to invalidate 
// an already-invalid session will result in an IllegalStateException.
if (session instanceof org.apache.struts2.dispatcher.SessionMap) {
    try {
        ((org.apache.struts2.dispatcher.SessionMap) session).invalidate();
    } catch (IllegalStateException e) {
        logger.error(msg, e);