You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by dl...@apache.org on 2002/04/23 18:03:34 UTC
cvs commit: jakarta-turbine-3/src/java/org/apache/turbine/modules/actions LogoutUser.java
dlr 02/04/23 09:03:34
Modified: src/java/org/apache/turbine/modules/actions LogoutUser.java
Log:
Added checks for an invalidated session around call to HttpSession's
removeAttribute() method.
Revision Changes Path
1.5 +14 -2 jakarta-turbine-3/src/java/org/apache/turbine/modules/actions/LogoutUser.java
Index: LogoutUser.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/modules/actions/LogoutUser.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -u -r1.4 -r1.5
--- LogoutUser.java 20 Mar 2002 01:55:28 -0000 1.4
+++ LogoutUser.java 23 Apr 2002 16:03:33 -0000 1.5
@@ -54,6 +54,8 @@
* <http://www.apache.org/>.
*/
+import javax.servlet.http.HttpSession;
+
import org.apache.turbine.Turbine;
import org.apache.turbine.RunData;
import org.apache.turbine.modules.Action;
@@ -66,7 +68,7 @@
* the User object in the session.
*
* @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a>
- * @version $Id: LogoutUser.java,v 1.4 2002/03/20 01:55:28 brekke Exp $
+ * @version $Id: LogoutUser.java,v 1.5 2002/04/23 16:03:33 dlr Exp $
*/
public class LogoutUser
extends Action
@@ -117,7 +119,17 @@
// In the event that the current screen or related navigations
// require acl info, we cannot wait for Turbine to handle
// regenerating acl.
- data.getSession().removeAttribute(AccessControlList.SESSION_KEY);
+ HttpSession session = data.getSession();
+ if (session != null)
+ {
+ try
+ {
+ session.removeAttribute(AccessControlList.SESSION_KEY);
+ }
+ catch (IllegalStateException invalidatedSession)
+ {
+ }
+ }
// If this action name is the value of action.logout then we are
// being run before the session validator, so we don't need to
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>