struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Chacón Sánchez" <danielc...@gmail.com>
Subject Re: Erase Only some Session Objests and variables
Date Mon, 25 Sep 2006 21:15:55 GMT
thaaaaaaaaaaaaaanks!!!!!!!!!

I will use it

2006/9/25, Heidy Gutiérrez Guzmán <heidyguti@gmail.com>:
>
> You can use this code:
>
>    Enumeration enumeration = session.getAttributeNames();
>    while (enumeration.hasMoreElements()) {
>     String element = (String) enumeration.nextElement();
>        session.removeAttribute(element);
>    }
>
> If yo don't have delete any element, you can do this:
>
>    Enumeration enumeration = session.getAttributeNames();
>    while (enumeration.hasMoreElements()) {
>     String element = (String) enumeration.nextElement();
>     if(!element.matches("notDeleteElement") )
>         session.removeAttribute(element);
>    }
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message